home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 1999 #5 / 1999 CD 5 (black).iso / Delphi3 / install / data.z / BDE.INT < prev    next >
Encoding:
Text File  |  1997-08-05  |  267.5 KB  |  5,479 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Visual Component Library                 }
  5. {       BDE Interface Unit                              }
  6. {                                                       }
  7. {       Copyright (c) 1995,97 Borland International     }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit Bde;
  12.  
  13. {$Z+}
  14.  
  15. interface
  16.  
  17. uses Windows;
  18.  
  19. { Translated from IDAPI.H,  Revision 4.174 }
  20.  
  21. const
  22.   DBIINTFVER         = 400;             { Version of the interface }
  23.   DBIENGVERSION      = 400;             { Version of the engine (3.00) }
  24.  
  25. {-----------------------------------------------------------------------}
  26. {     DBI types                                                         }
  27. {-----------------------------------------------------------------------}
  28.  
  29.  
  30. { sdk debug layer defines }
  31.  
  32. const
  33.   DEBUGON            = $1;
  34.   OUTPUTTOFILE       = $2;
  35.   FLUSHEVERYOP       = $8;
  36.   APPENDTOLOG        = $10;
  37.  
  38. { Constants }
  39.  
  40.   DBIMAXNAMELEN      = 31;              { Name limit (table, field etc) }
  41.   DBIMAXSPNAMELEN    = 64;              { Max stored procedure name length }
  42.   DBIMAXFUNCNAMELEN  = 255;             { Max function name len }
  43.   DBIMAXFLDSINKEY    = 16;              { Max fields in a key }
  44.   DBIMAXKEYEXPLEN    = 220;             { Max Key expression length }
  45.   DBIMAXEXTLEN       = 3;               { Max file extension len, not incl. dot (excluding zero termination) }
  46.   DBIMAXTBLNAMELEN   = 260;             { Max table name length }
  47.   DBIMAXDRIVELEN     = 127;             { Max drive length }
  48.   DBIMAXPATHLEN      = 260;             { Max path+file name len (excluding zero termination) }
  49.   DBIMAXMSGLEN       = 127;             { Max message len }
  50.   DBIMAXVCHKLEN      = 255;             { Max val check len }
  51.   DBIMAXPICTLEN      = 175;             { Max picture len }
  52.   DBIMAXFLDSINSEC    = 256;             { Max fields in security spec }
  53.  
  54.   DBIMAXSCFIELDS     = 40;              { max nbr of fields in a config section }
  55.   DBIMAXSCFLDLEN     = 128;             { max field length }
  56.   DBIMAXSCRECSIZE    = DBIMAXSCFIELDS*DBIMAXSCFLDLEN; { max rec size }
  57.  
  58.   DBIMAXUSERNAMELEN  = 14;              { Max user name (general) }
  59.   DBIMAXXBUSERNAMELEN = 16;             { Max user name length (xBASE) }
  60.   DBIMAXBOOKMARKLEN  = 4104;            { Max Bookmark length }
  61.  
  62.   DBIMAXTRACELEN     = 8192;            { Max trace msg len }
  63.  
  64.   DBIMAXTYPEDESC     = 127;             { Max Type Description size }
  65.   DBIMAXDRSQLSTR     = 8192;            { Max Size of SQL Constraint }
  66.  
  67.   DBIMAXOLEDBNAMELEN = 64;              { Max OLE DB name length }
  68.  
  69. {============================================================================}
  70. {                             G e n e r a l                                  }
  71. {============================================================================}
  72.  
  73. type
  74.   DBIDATE            = Longint;
  75.   TIME               = Longint;
  76.   TIMESTAMP          = Double;
  77.   DBIResult          = Word;         { Function result }
  78.   TypedEnum          = Integer;
  79.   PLocale            = Pointer;
  80.  
  81. { Handle Types }
  82.  
  83.   _hDBIObj           = record end;      { Dummy structure to create "typed" handles }
  84.   hDBIObj            = ^_hDBIObj;       { Generic object handle }
  85.   hDBIDb             = ^_hDBIObj;       { Database handle }
  86.   hDBIQry            = ^_hDBIObj;       { Query handle }
  87.   hDBIStmt           = ^_hDBIObj;       { Statement handle ("new query") }
  88.   hDBICur            = ^_hDBIObj;       { Cursor handle }
  89.   hDBISes            = ^_hDBIObj;       { Session handle }
  90.   hDBIXlt            = ^_hDBIObj;       { Translation handle }
  91.   hDBICfg            = ^_hDBIObj;       { Configuration handle }
  92.   hDBIXact           = ^_hDBIObj;       { Transaction handle }
  93.   hDBIFilter         = ^_hDBIObj;       { Filter handle }
  94.   hDBIDR             = ^_hDBIObj;       { Handle to a Client Data Repository (CDR) Object }
  95.  
  96.  
  97. { Handle Pointers }
  98.  
  99.   phDBIObj           = ^hDBIObj;        { Pointer to Generic object handle }
  100.   phDBIDb            = ^hDBIDb;         { Pointer to Database handle }
  101.   phDBIQry           = ^hDBIQry;        { Pointer to Query handle }
  102.   phDBIStmt          = ^hDBIStmt;       { Pointer to Statement handle }
  103.   phDBICur           = ^hDBICur;        { Pointer to Cursor handle }
  104.   phDBISes           = ^hDBISes;        { Pointer to Session handle }
  105.   phDBIXlt           = ^hDBIXlt;        { Pointer to Translation handle }
  106.   phDBICfg           = ^hDBICfg;        { Pointer to Configuration handle }
  107.   phDBIXact          = ^hDBIXact;       { Pointer to Transaction handle }
  108.   phDBIFilter        = ^hDBIFilter;     { Pointer to Filter handle }
  109.   phDBIDR            = ^hDBIDR;         { Pointer to CDR Handle }
  110.  
  111. { typedefs for buffers of various common sizes: }
  112.  
  113.   DBIPATH            = packed array [0..DBIMAXPATHLEN] of Char; { holds a DOS path }
  114.   DBINAME            = packed array [0..DBIMAXNAMELEN] of Char; { holds a name }
  115.   DBIEXT             = packed array [0..DBIMAXEXTLEN] of Char; { holds an extension EXT }
  116.   DBIDOTEXT          = packed array [0..DBIMAXEXTLEN+1] of Char; { holds an extension EXT including '.' }
  117.   DBIDRIVE           = packed array [0..DBIMAXDRIVELEN] of Char; { holds a drive name }
  118.   DBITBLNAME         = packed array [0..DBIMAXTBLNAMELEN] of Char; { holds a table name }
  119.   DBISPNAME          = packed array [0..DBIMAXSPNAMELEN] of Char; { holds a stored procedure name }
  120.   DBIUSERNAME        = packed array [0..DBIMAXUSERNAMELEN] of Char; { holds a user name }
  121.   DBIKEY             = packed array [0..DBIMAXFLDSINKEY-1] of Word; { holds list of fields in a key }
  122.   DBIKEYEXP          = packed array [0..DBIMAXKEYEXPLEN] of Char; { holds a key expression }
  123.   DBIVCHK            = packed array [0..DBIMAXVCHKLEN] of Byte; { holds a validity check }
  124.   DBIPICT            = packed array [0..DBIMAXPICTLEN] of Char; { holds a picture (Pdox) }
  125.   DBIMSG             = packed array [0..DBIMAXMSGLEN] of Char; { holds an error message }
  126.   DBIDRTYPEDESC      = packed array [0..DBIMAXTYPEDESC] of Char; { holds a Type Description string }
  127.   DBISQLSTR          = packed array [0..DBIMAXDRSQLSTR] of Char; { a SQL string }
  128.  
  129.  
  130. {============================================================================}
  131. {                             Environmental                                  }
  132. {============================================================================}
  133.  
  134. type
  135.   pDBIEnv = ^DBIEnv;
  136.   DBIEnv = packed record                { Struct for defining the environ. }
  137.     szWorkDir       : DBIPATH;          { Working directory }
  138.     szIniFile       : DBIPATH;          { Configuration file }
  139.     bForceLocalInit : WordBool;         { Force local initialization }
  140.     szLang          : DBINAME;          { System language driver }
  141.     szClientName    : DBINAME;          { Client name (documentary) }
  142.   end;
  143.  
  144. {============================================================================}
  145. {                   System Info                                              }
  146. {============================================================================}
  147.  
  148. type
  149.   pSYSVersion = ^SYSVersion;
  150.   SYSVersion = packed record            { System Version Info }
  151.     iVersion        : Word;             { Engine version }
  152.     iIntfLevel      : Word;             { Client Interface level }
  153.     dateVer         : DBIDATE;          { Version date (Compile/Release) }
  154.     timeVer         : Time;             { Version time (Compile/Release) }
  155.     szVersion       : array [0..19] of Char; { Version name (xxx.xxx.xxx.xxx) }
  156.   end;
  157.  
  158.   pSYSConfig = ^SYSConfig;
  159.   SYSConfig = packed record             { System configuration (basic) }
  160.     bLocalShare     : WordBool;         { If Local files will be shared }
  161.     iNetProtocol    : Word;             { Net Protocol (35, 40 etc.) }
  162.     bNetShare       : WordBool;         { If Net files will be shared }
  163.     szNetType       : DBINAME;          { Network type }
  164.     szUserName      : DBIUSERNAME;      { Network user name }
  165.     szIniFile       : DBIPATH;          { Configuration file }
  166.     szLangDriver    : DBINAME;          { System language driver }
  167.   end;
  168.  
  169.   pSYSInfo = ^SYSInfo;
  170.   SYSInfo = packed record               { System Status/Info }
  171.     iBufferSpace    : Word;             { in K }
  172.     iHeapSpace      : Word;             { in K }
  173.     iDrivers        : Word;             { Active/Loaded drivers }
  174.     iClients        : Word;             { Active clients }
  175.     iSessions       : Word;             { Number of sessions (For all clients) }
  176.     iDatabases      : Word;             { Open databases }
  177.     iCursors        : Word;             { Number of cursors }
  178.   end;
  179.  
  180.   pCLIENTInfo = ^CLIENTInfo;
  181.   CLIENTInfo = packed record
  182.     szName          : DBINAME;          { Documentary name }
  183.     iSessions       : Word;             { Number of sessions }
  184.     szWorkDir       : DBIPATH;          { Working directory }
  185.     szLang          : DBINAME;          { System language driver (Client supplied) }
  186.   end;
  187.  
  188.   pSESInfo = ^SESInfo;
  189.   SESInfo = packed record
  190.     iSession        : Word;             { Session id (1..n) }
  191.     szName          : DBINAME;          { Documentary name }
  192.     iDatabases      : Word;             { Open databases }
  193.     iCursors        : Word;             { Open cursors }
  194.     iLockWait       : SmallInt;         { Lock wait time (in seconds) }
  195.     szNetDir        : DBIPATH;          { Net directory location }
  196.     szPrivDir       : DBIPATH;          { Current Private directory }
  197.   end;
  198.  
  199. {============================================================================}
  200. {                             Table / Field Types                            }
  201. {============================================================================}
  202.  
  203. { Driver Types }
  204.  
  205. const
  206.   szPARADOX          = 'PARADOX';
  207.   szDBASE            = 'DBASE';
  208.   szASCII            = 'ASCIIDRV';
  209.   szOLEDB            = 'OLEDBDRV';
  210.   szMSACCESS         = 'MSACCESS'; 
  211.  
  212.  
  213. { Field Types (Logical) }
  214.  
  215.   fldUNKNOWN         = 0;
  216.   fldZSTRING         = 1;               { Null terminated string }
  217.   fldDATE            = 2;               { Date     (32 bit) }
  218.   fldBLOB            = 3;               { Blob }
  219.   fldBOOL            = 4;               { Boolean  (16 bit) }
  220.   fldINT16           = 5;               { 16 bit signed number }
  221.   fldINT32           = 6;               { 32 bit signed number }
  222.   fldFLOAT           = 7;               { 64 bit floating point }
  223.   fldBCD             = 8;               { BCD }
  224.   fldBYTES           = 9;               { Fixed number of bytes }
  225.   fldTIME            = 10;              { Time        (32 bit) }
  226.   fldTIMESTAMP       = 11;              { Time-stamp  (64 bit) }
  227.   fldUINT16          = 12;              { Unsigned 16 bit integer }
  228.   fldUINT32          = 13;              { Unsigned 32 bit integer }
  229.   fldFLOATIEEE       = 14;              { 80-bit IEEE float }
  230.   fldVARBYTES        = 15;              { Length prefixed var bytes }
  231.   fldLOCKINFO        = 16;              { Look for LOCKINFO typedef }
  232.   fldCURSOR          = 17;              { For Oracle Cursor type }
  233.  
  234.   MAXLOGFLDTYPES     = 18;              { Number of logical fieldtypes }
  235.  
  236. { Sub Types (Logical) }
  237.  
  238. { fldFLOAT subtype }
  239.  
  240.   fldstMONEY         = 21;              { Money }
  241.  
  242. { fldBLOB subtypes }
  243.  
  244.   fldstMEMO          = 22;              { Text Memo }
  245.   fldstBINARY        = 23;              { Binary data }
  246.   fldstFMTMEMO       = 24;              { Formatted Text }
  247.   fldstOLEOBJ        = 25;              { OLE object (Paradox) }
  248.   fldstGRAPHIC       = 26;              { Graphics object }
  249.   fldstDBSOLEOBJ     = 27;              { dBASE OLE object }
  250.   fldstTYPEDBINARY   = 28;              { Typed Binary data }
  251.   fldstACCOLEOBJ     = 30;              { Access OLE object }
  252.  
  253. { fldZSTRING subtype }
  254.  
  255.   fldstPASSWORD      = 1;               { Password }
  256.   fldstFIXED         = 31;              { CHAR type }
  257.  
  258. { fldINT32 subtype }
  259.  
  260.   fldstAUTOINC       = 29;
  261.  
  262. { Paradox types (Physical) }
  263.  
  264.   fldPDXCHAR         = $101;            { Alpha    (string) }
  265.   fldPDXNUM          = $102;            { Numeric }
  266.   fldPDXMONEY        = $103;            { Money }
  267.   fldPDXDATE         = $104;            { Date }
  268.   fldPDXSHORT        = $105;            { Short }
  269.   fldPDXMEMO         = $106;            { Text Memo       (blob) }
  270.   fldPDXBINARYBLOB   = $107;            { Binary data     (blob) }
  271.   fldPDXFMTMEMO      = $108;            { Formatted text  (blob) }
  272.   fldPDXOLEBLOB      = $109;            { OLE object      (blob) }
  273.   fldPDXGRAPHIC      = $10A;            { Graphics object (blob) }
  274.   fldPDXBLOB         = fldPDXMEMO;
  275.   fldPDXLONG         = $10B;            { Long }
  276.   fldPDXTIME         = $10C;            { Time }
  277.   fldPDXDATETIME     = $10D;            { Time Stamp }
  278.   fldPDXBOOL         = $10E;            { Logical }
  279.   fldPDXAUTOINC      = $10F;            { Auto increment (long) }
  280.   fldPDXBYTES        = $110;            { Fixed number of bytes }
  281.   fldPDXBCD          = $111;            { BCD (32 digits) }
  282.   fldPDXUNICHAR      = $112;            { not supported yet }
  283.  
  284. { xBASE types (Physical) }
  285.  
  286.   fldDBCHAR          = $201;            { Char string }
  287.   fldDBNUM           = $202;            { Number }
  288.   fldDBMEMO          = $203;            { Memo          (blob) }
  289.   fldDBBOOL          = $204;            { Logical }
  290.   fldDBDATE          = $205;            { Date }
  291.   fldDBFLOAT         = $206;            { Float }
  292.   fldDBLOCK          = $207;            { Logical type is LOCKINFO }
  293.   fldDBOLEBLOB       = $208;            { OLE object    (blob) }
  294.   fldDBBINARY        = $209;            { Binary data   (blob) }
  295.   fldDBBYTES         = $20A;            { Only for TEMPORARY tables }
  296.   fldDBLONG          = $20B;            { Long (Integer) }
  297.   fldDBDATETIME      = $20C;            { Time Stamp }
  298.   fldDBDOUBLE        = $20D;            { Double }
  299.   fldDBAUTOINC       = $20E;            { Auto increment (long) }
  300.  
  301. { xBASE key types (Cannot be used as field types) }
  302.  
  303.   fldDBKEYNUM        = $210;
  304.   fldDBKEYBCD        = $211;
  305.  
  306.  
  307. { Ascii types (Physical) }
  308.  
  309.   fldASCCHAR         = $301;            { Char string }
  310.   fldASCNUM          = $302;            { Number }
  311.   fldASCBOOL         = $303;            { Logical }
  312.   fldASCDATE         = $304;            { Date }
  313.   fldASCFLOAT        = $305;            { Float }
  314.   fldASCLOCK         = $306;            { Not used }
  315.   fldASCTIMESTAMP    = $307;            { TimeStamp }
  316.   fldASCTIME         = $308;            { Time }
  317.   fldASCLONG         = $309;            { Long }
  318.   fldASCMONEY        = $30A;            { Money }
  319.  
  320. { MS Access types (Physical) }
  321.  
  322.   fldACCCHAR         = $701;            { Fixed length Character }
  323.   fldACCVARCHAR      = $702;            { Variable length Character }
  324.   fldACCDATETIME     = $703;            { Date/Time }
  325.   fldACCBIT          = $704;            { Boolean }
  326.   fldACCMONEY        = $705;            { Currency }
  327.   fldACCSHORT        = $706;            { Short }
  328.   fldACCLONG         = $707;            { Long }
  329.   fldACCFLOAT        = $708;            { Float }
  330.   fldACCLONGTEXT     = $709;            { Memo }
  331.   fldACCLONGBINARY   = $70A;            { OLE Object }
  332.   fldACCAUTOINC      = $70B;            { Auto Number }
  333.   fldACCBYTE         = $70C;            { Byte }
  334.   fldACCDOUBLE       = $70D;            { Double }
  335.   fldACCBINARY       = $70E;            { Binary }
  336.  
  337.  
  338. {============================================================================}
  339. {                    Field descriptor                                        }
  340. {============================================================================}
  341.  
  342.  
  343. type
  344.   FLDVchk = (                           { Field Val Check type }
  345.     fldvNOCHECKS,                       { Does not have explicit val checks }
  346.     fldvHASCHECKS,                      { One or more val checks on the field }
  347.     fldvUNKNOWN                         { Dont know at this time }
  348.   );
  349.  
  350. type
  351.   FLDRights = (                         { Field Rights }
  352.     fldrREADWRITE,                      { Field can be Read/Written }
  353.     fldrREADONLY,                       { Field is Read only }
  354.     fldrNONE,                           { No Rights on this field }
  355.     fldrUNKNOWN                         { Dont know at this time }
  356.   );
  357.  
  358. type
  359.   pFLDDesc = ^FLDDesc;
  360.   FLDDesc = packed record               { Field Descriptor }
  361.     iFldNum         : Word;             { Field number (1..n) }
  362.     szName          : DBINAME;          { Field name }
  363.     iFldType        : Word;             { Field type }
  364.     iSubType        : Word;             { Field subtype (if applicable) }
  365.     iUnits1         : SmallInt;         { Number of Chars, digits etc }
  366.     iUnits2         : SmallInt;         { Decimal places etc. }
  367.     iOffset         : Word;             { Offset in the record (computed) }
  368.     iLen            : Word;             { Length in bytes (computed) }
  369.     iNullOffset     : Word;             { For Null bits (computed) }
  370.     efldvVchk       : FLDVchk;          { Field Has vcheck (computed) }
  371.     efldrRights     : FLDRights;        { Field Rights (computed) }
  372.     bCalcField      : WordBool;         { Is Calculated field (computed) }
  373.     iUnUsed         : packed array [0..1] of Word;
  374.   end;
  375.  
  376. { ============================================================================ }
  377. {                    Blob parameter descriptor                                 }
  378. { ============================================================================ }
  379.  
  380. type
  381.   pBLOBParamDesc = ^BLOBParamDesc;
  382.   BLOBParamDesc = packed record
  383.     pBlobBuffer     : Pointer;          { Blob buffer (client) }
  384.     ulBlobLen       : Integer;          { Length of the blob }
  385.     iUnUsed         : packed array[0..3] of Word;
  386.   end;
  387.  
  388. {============================================================================}
  389. {                    Index descriptor                                        }
  390. {============================================================================}
  391.  
  392. const
  393.   mdxDISTINCT      = $0020;         { OR with bUnique for dBASE distinct tags }
  394.  
  395. type
  396.   pIDXDesc = ^IDXDesc;
  397.   IDXDesc = packed record               { Index description }
  398.     szName          : DBITBLNAME;       { Index name }
  399.     iIndexId        : Word;             { Index number }
  400.     szTagName       : DBINAME;          { Tag name (for dBASE) }
  401.     szFormat        : DBINAME;          { Optional format (BTREE, HASH etc) }
  402.     bPrimary        : WordBool;         { True, if primary index }
  403.     bUnique         : WordBool;         { True, if unique keys (TRI-STATE for dBASE) }
  404.     bDescending     : WordBool;         { True, for descending index }
  405.     bMaintained     : WordBool;         { True, if maintained index }
  406.     bSubset         : WordBool;         { True, if subset index }
  407.     bExpIdx         : WordBool;         { True, if expression index }
  408.     iCost           : Word;             { Not used }
  409.     iFldsInKey      : Word;             { Fields in the key (1 for Exp) }
  410.     iKeyLen         : Word;             { Phy Key length in bytes (Key only) }
  411.     bOutofDate      : WordBool;         { True, if index out of date }
  412.     iKeyExpType     : Word;             { Key type of Expression }
  413.     aiKeyFld        : DBIKEY;           { Array of field numbers in key }
  414.     szKeyExp        : DBIKEYEXP;        { Key expression }
  415.     szKeyCond       : DBIKEYEXP;        { Subset condition }
  416.     bCaseInsensitive : WordBool;        { True, if case insensitive index }
  417.     iBlockSize      : Word;             { Block size in bytes }
  418.     iRestrNum       : Word;             { Restructure number }
  419.     abDescending    : packed array [0..DBIMAXFLDSINKEY-1] of WordBool; { TRUE }
  420.     iUnUsed         : packed array [0..15] of Word;
  421.   end;
  422.  
  423. {============================================================================}
  424. {             Validity check, Referential integrity descriptors              }
  425. {============================================================================}
  426.  
  427.  
  428.  
  429. { Subtypes for Lookup }
  430.  
  431.   LKUPType = (                          { Paradox Lookup type }
  432.     lkupNONE,                           { Has no lookup }
  433.     lkupPRIVATE,                        { Just Current Field + Private }
  434.     lkupALLCORRESP,                     { All Corresponding + No Help }
  435.     lkupHELP,                           { Just Current Fld + Help and Fill }
  436.     lkupALLCORRESPHELP                  { All Corresponging + Help }
  437.   );
  438.  
  439. const
  440.   TODAYVAL           = 2;               { for Min/Max/Def val flags }
  441.   NOWVAL             = 3;               { for Min/Max/Def val flags }
  442.  
  443.    { In VCHKDesc below, if any of bHasMinVal/bHasMaxVal/bHasDefVal }
  444.    { = TODAYVAL, then TODAY is assumed , = NOWVAL, then current time/today is assumed }
  445.  
  446. type
  447.   pVCHKDesc = ^VCHKDesc;
  448.   VCHKDesc = packed record              { Val Check structure }
  449.     iFldNum         : Word;             { Field number }
  450.     bRequired       : WordBool;         { If True, value is required }
  451.     bHasMinVal      : WordBool;         { If True, has min value }
  452.     bHasMaxVal      : WordBool;         { If True, has max value }
  453.     bHasDefVal      : WordBool;         { If True, has default value }
  454.     aMinVal         : DBIVCHK;          { Min Value }
  455.     aMaxVal         : DBIVCHK;          { Max Value }
  456.     aDefVal         : DBIVCHK;          { Default value }
  457.     szPict          : DBIPICT;          { Picture string }
  458.     elkupType       : LKUPType;         { Lookup/Fill type }
  459.     szLkupTblName   : DBIPATH;          { Lookup Table name }
  460.   end;
  461.  
  462.   RINTType = (                          { Ref integrity type }
  463.     rintMASTER,                         { This table is Master }
  464.     rintDEPENDENT                       { This table is Dependent }
  465.   );
  466.  
  467.   RINTQual = (                          { Ref integrity action/qualifier }
  468.     rintRESTRICT,                       { Prohibit operation }
  469.     rintCASCADE                         { Cascade operation }
  470.   );
  471.  
  472.   pRINTDesc = ^RINTDesc;
  473.   RINTDesc = packed record              { Ref Integrity Desc }
  474.     iRintNum        : Word;             { Ref integrity number }
  475.     szRintName      : DBINAME;          { A name to tag this integegrity constraint }
  476.     eType           : RINTType;         { Whether master/dependent }
  477.     szTblName       : DBIPATH;          { Other table name }
  478.     eModOp          : RINTQual;         { Modify qualifier }
  479.     eDelOp          : RINTQual;         { Delete qualifier }
  480.     iFldCount       : Word;             { Fields in foreign key }
  481.     aiThisTabFld    : DBIKEY;           { Fields in this table }
  482.     aiOthTabFld     : DBIKEY;           { Fields in other table }
  483.   end;
  484.  
  485.  
  486. {============================================================================}
  487. {                    Security descriptor                                     }
  488. {============================================================================}
  489. { Family rights }
  490.  
  491. const
  492.   NOFAMRIGHTS        = $00;             { No Family rights }
  493.   FORMRIGHTS         = $01;             { Can change form }
  494.   RPTRIGHTS          = $02;             { Can change reports }
  495.   VALRIGHTS          = $04;             { Can change valchecks }
  496.   SETRIGHTS          = $08;             { Can change settings }
  497.   ALLFAMRIGHTS       = (FORMRIGHTS or RPTRIGHTS or VALRIGHTS or SETRIGHTS);
  498.                                              { All family rights }
  499.  
  500. type
  501.   PRVType = TypedEnum;
  502. const
  503.     prvNONE      = 0;                   { No privilege }
  504.     prvREADONLY  = 1;                   { Read only Table or Field }
  505.     prvMODIFY    = 3;                   { Read and Modify fields (non-key) }
  506.     prvINSERT    = 7;                   { Insert + All of above }
  507.     prvINSDEL    = $0F;                 { Delete + All of above }
  508.     prvFULL      = $1F;                 { Full Writes }
  509.     prvUNKNOWN   = $FF;                 { Unknown }
  510.  
  511. type
  512.   pSECDesc = ^SECDesc;
  513.   SECDesc = packed record               { Security description }
  514.     iSecNum         : Word;             { Nbr to identify desc }
  515.     eprvTable       : PrvType;          { Table privileges }
  516.     iFamRights      : Word;             { Family rights }
  517.     szPassword      : DBINAME;          { Null terminated string }
  518.     aprvFld         : packed array [0..DBIMAXFLDSINSEC-1] of PrvType;
  519.                      { Field level privileges (prvNONE/prvREADONLY/prvFULL) }
  520.   end;
  521.  
  522. {============================================================================}
  523. {                            Miscellaneous                                   }
  524. {============================================================================}
  525.  
  526. { Index Id used to open table without a default index (i.e. no order) }
  527.  
  528. const
  529.   NODEFAULTINDEX     = $FFFF;
  530.  
  531.  
  532. {============================================================================}
  533. {                    Object types                                            }
  534. {============================================================================}
  535.  
  536. type
  537.   DBIOBJType = (
  538.     objFILLER,                          { Filler to make next start at 1 }
  539.     objSYSTEM,                          { System object }
  540.     objSESSION,                         { Session object }
  541.     objDRIVER,                          { Driver object }
  542.     objDATABASE,                        { Database object }
  543.     objCURSOR,                          { Cursor object }
  544.     objSTATEMENT,                       { Statement object }
  545.     objCLIENT,                          { Client object }
  546.     objDBSEC,                           { DbSystem object (dBASE only) }
  547.     objREPOSITORY                       { Data Repository object }
  548.   );
  549.  
  550. {============================================================================}
  551. {                    Cursor properties                                       }
  552. {============================================================================}
  553.  
  554. type
  555.   DBIShareMode = (                      { Database/Table Share type }
  556.     dbiOPENSHARED,                      { Open shared  (Default) }
  557.     dbiOPENEXCL                         { Open exclusive }
  558.   );
  559.  
  560.   DBIOpenMode = (                       { Database/Table Access type }
  561.     dbiREADWRITE,                       { Read + Write   (Default) }
  562.     dbiREADONLY                         { Read only }
  563.   );
  564.  
  565.   DBILockType = (                       { Lock types (Table level) }
  566.     dbiNOLOCK,                          { No lock   (Default) }
  567.     dbiWRITELOCK,                       { Write lock }
  568.     dbiREADLOCK                         { Read lock }
  569.   );
  570.  
  571.   XLTMode = (                           { Field translate mode }
  572.     xltNONE,                            { No translation  (Physical Types) }
  573.     xltRECORD,                          { Record level translation (not supported) }
  574.     xltFIELD                            { Field level translation (Logical types) }
  575.   );
  576.  
  577.   UPDLockMode = (                       { Update lock mode (SQL only) }
  578.     updWHEREALL,                        { All fields in WHERE clause }
  579.     updWHEREKEYCHG,                     { Keyed and changed fields in WHERE clause }
  580.     updWHEREKEY                         { Keyed fields in WHERE clause }
  581.   );
  582.  
  583. { Table levels }
  584.  
  585. const
  586.   TBLLEVEL3          = 3;               { Paradox level 3 and dBASE level 3+ }
  587.   TBLLEVEL4          = 4;               { Paradox level 4 and dBASE level 4 }
  588.   TBLLEVEL5          = 5;               { Paradox level 5 and dBASE/Win }
  589.   TBLLEVEL7          = 7;               { Paradox level 7 , Win32 }
  590.   FOXLEVEL25         = 25;              { Fox Table (Ver 2.5) }
  591.  
  592. type
  593.   pCURProps = ^CURProps;
  594.   CURProps = packed record              { Virtual Table properties }
  595.     szName          : DBITBLNAME;       { table name (no extension, if it can be derived) }
  596.     iFNameSize      : Word;             { Full file name size }
  597.     szTableType     : DBINAME;          { Driver type }
  598.     iFields         : Word;             { No of fields in Table }
  599.     iRecSize        : Word;             { Record size (logical record) }
  600.     iRecBufSize     : Word;             { Record size (physical record) }
  601.     iKeySize        : Word;             { Key size }
  602.     iIndexes        : Word;             { Number of indexes }
  603.     iValChecks      : Word;             { Number of val checks }
  604.     iRefIntChecks   : Word;             { Number of Ref Integrity constraints }
  605.     iBookMarkSize   : Word;             { Bookmark size }
  606.     bBookMarkStable : WordBool;         { Stable book marks }
  607.     eOpenMode       : DBIOpenMode;      { ReadOnly / RW }
  608.     eShareMode      : DBIShareMode;     { Excl / Share }
  609.     bIndexed        : WordBool;         { Index is in use }
  610.     iSeqNums        : SmallInt;         { 1: Has Seqnums; 0: Has Record# }
  611.     bSoftDeletes    : WordBool;         { Supports soft deletes }
  612.     bDeletedOn      : WordBool;         { If above, deleted recs seen }
  613.     iRefRange       : Word;             { Not used }
  614.     exltMode        : XLTMode;          { Translate Mode }
  615.     iRestrVersion   : Word;             { Restructure version number }
  616.     bUniDirectional : WordBool;         { Cursor is uni-directional }
  617.     eprvRights      : Word;             { Table  rights }
  618.     Dummy4          : Word;
  619.     iFmlRights      : Word;             { Family rights }
  620.     iPasswords      : Word;             { Number of Aux passwords }
  621.     iCodePage       : Word;             { Codepage (0 if unknown) }
  622.     bProtected      : WordBool;         { Table is protected by password }
  623.     iTblLevel       : Word;             { Driver dependent table level }
  624.     szLangDriver    : DBINAME;          { Language driver name }
  625.     bFieldMap       : WordBool;         { Field map active }
  626.     iBlockSize      : Word;             { Physical file blocksize in K }
  627.     bStrictRefInt   : WordBool;         { Strict referential integrity }
  628.     iFilters        : Word;             { Number of filters }
  629.     bTempTable      : WordBool;         { Table is a temporary table }
  630.     iUnUsed         : packed array [0..15] of Word;
  631.   end;
  632.  
  633. { Delayed Update Types and Constants }
  634.  
  635. type
  636.   DBIDelayedUpdCmd = (                  { Op types for Delayed Update cursor }
  637.     dbiDelayedUpdCommit,                { Commit the updates }
  638.     dbiDelayedUpdCancel,                { Rollback the updates }
  639.     dbiDelayedUpdCancelCurrent,         { Cancel the Current Rec Change }
  640.     dbiDelayedUpdPrepare                { Phase1 of 2 phase commit }
  641.   );
  642.  
  643. const
  644.   DBIDELAYUPD_SHOWMODIFYBIT    = $1;    { Show only modified records. }
  645.   DBIDELAYUPD_SHOWINSERTBIT    = $2;    { Show only inserted records. }
  646.   DBIDELAYUPD_SHOWDELETEBIT    = $4;    { Show only deleted records. }
  647.   DBIDELAYUPD_SHOWNONMODIFYBIT = $8;    { Show only unmodified recs. }
  648.  
  649. {============================================================================}
  650. {                   Record Properties                                        }
  651. {============================================================================}
  652.  
  653. type
  654.   pRECProps = ^RECProps;
  655.   RECProps = packed record              { Record properties }
  656.     iSeqNum         : Longint;          { When Seq# supported only }
  657.     iPhyRecNum      : Longint;          { When Phy Rec#s supported only }
  658.     iRecStatus      : Word;             { Delayed Updates Record Status }
  659.     bSeqNumChanged  : WordBool;         { Not used }
  660.     bDeleteFlag     : WordBool;         { When soft delete supported only }
  661.   end;
  662.  
  663.  
  664. {============================================================================}
  665. {                   General properties  DbiGetProp/DbiSetProp                }
  666. {============================================================================}
  667.  
  668.  
  669. { Cursor properties }
  670. { General           }
  671.  
  672. const
  673.   curMAXPROPS        = $00050000;       { ro UINT16   , Number of defined properties }
  674.   curTABLENAME       = $00050001;       { ro pTBLNAME , Table name }
  675.   curTABLETYPE       = $00050002;       { ro pDBINAME , Table type }
  676.   curTABLELEVEL      = $00050003;       { ro UINT16   , Table level 1..n }
  677.   curFILENAME        = $00050004;       { ro pPATH    , Full filename }
  678.   curXLTMODE         = $00050005;       { rw XLTMode  , Translate mode }
  679.   curSEQREADON       = $00050006;       { rw BOOL     , Sequential read mode hint ON }
  680.   curONEPASSON       = $00050007;       { rw BOOL     , One pass mode hint ON }
  681.   curUPDATETS        = $00050008;       { ro TIMESTAMP, Update timestamp }
  682.   curSOFTDELETEON    = $00050009;       { rw BOOL     , Softdelete ON }
  683.   curLANGDRVNAME     = $0005000A;       { ro pCHAR    , Symbolic language drv. name }
  684.   curCURSORNAME      = $0005000B;       { ro pCHAR    , name of the cursor }
  685.   maxcurPROPS        = 11;              { keep in sync when adding cursor properties }
  686.  
  687. { Paradox specific }
  688.   curPDXMAXPROPS     = $01050000;       { ro UINT16   , Number of defined properties }
  689.   maxcurPDXPROPS     = 0;
  690.  
  691. { DBase specific }
  692.   curDBMAXPROPS      = $02050000;       { ro UINT16   , Number of defined properties }
  693.   curINEXACTON       = $02050001;       { rw BOOL     , InExact match ON }
  694.   curSHAREMODE       = $02050002;       { rw DBIShareMode, Share mode }
  695.   maxcurDBPROPS      = 2;
  696.  
  697. { Text Driver specific }
  698.   curDELIMITALLFLDS  = $03050000;       { rw BOOL , Delimit all fields. }
  699.   curUSESCHEMAFILE   = $03050001;       { rw BOOL , read schema from a file }
  700.  
  701. { SQL Driver specific }
  702.   curUPDLOCKMODE     = $04050000;       { rw UPDLockMode, Update lock mode }
  703.   curNATIVEHNDL      = $04050001;       { ro pBYTE, Native cursor handle }
  704.   curMAXROWS         = $04050002;       { rw INT32, Max rows to fetch from server }
  705.   curGETEXTENDEDINFO = $04050003;       { rw BOOL, Get RINT info etc. }
  706.   curGETHIDDENCOLUMNS= $04050004;       { rw BOOL , Get all selected columns from server. }
  707.   curCONSTSTATE      = $0405009B;       { rw BOOL, enable/disable constraints }
  708.  
  709. { Delayed Updates Specific. }
  710.   curDELAYUPDRECSTATE     = $05050001;  { ro DELYUPDCbDesc }
  711.   curDELAYUPDABORTRESTORE = $05050002;  { rw BOOL, restore state }
  712.                                         {  when commit is aborted. }
  713.   curDELAYUPDDISPLAYOPT   = $05050003;  { rw UINT16, view records }
  714.                                         {  with specific update status }
  715.   curDELAYUPDGETOLDRECORD = $05050004;  { rw BOOL, get un-modified }
  716.                                         {  rec buf for modified recs }
  717.   curDELAYUPDNUMUPDATES   = $05050005;  { ro INT32, num of updates }
  718.   curDELAYUPDUSECALLBACK  = $05050006;  { rw BOOL, callback usr. }
  719.  
  720. { Driver properties }
  721. { General           }
  722.   drvMAXPROPS        = $00030000;       { ro UINT16   , Number of defined properties }
  723.   drvDRIVERTYPE      = $00030002;       { ro pDBINAME , Driver type }
  724.   drvDRIVERVERSION   = $00030003;       { ro UINT16   , Driver version }
  725.   maxdrvPROPS        = 2;               { keep in sync when adding driver properties }
  726.  
  727.   drvPSEUDOINDEX     = $ff030001;       { ro BOOL, Pseudo Index Support. }
  728.   
  729. { SQL Driver specific }
  730.   drvNATIVESQLCA     = $00030004;       { ro pBYTE    , Native SQLCA structure (Informix) }
  731.  
  732. { Database properties }
  733. { General             }
  734.   dbMAXPROPS         = $00040000;       { ro UINT16   , Number of defined properties }
  735.   dbDATABASENAME     = $00040001;       { ro pDBINAME , Database name/alias }
  736.   dbDATABASETYPE     = $00040002;       { ro pDBINAME , Database type }
  737.   dbDEFAULTDRIVER    = $00040003;       { rw pDBINAME , Default Driver name }
  738.   dbPARAMFMTQMARK    = $00040004;       { rw BOOL     , Stmt param marker fmt = ? }
  739.   dbUSESCHEMAFILE    = $00040005;       { rw BOOL , for text driver only. }
  740.   maxdbPROPS         = 22;              { keep in sync when adding ANY db properties }
  741.  
  742. { SQL Driver specific }
  743.   dbASYNCSUPPORT     = $04040000;       { ro BOOL     , Async. qry exec support }
  744.   dbPROCEDURES       = $04040001;       { ro BOOL     , Stored procedure support }
  745.   dbDEFAULTTXNISO    = $04040002;       { ro eXILType , Default transaction iso level }
  746.   dbNATIVEHNDL       = $04040003;       { ro pBYTE    , Native connection handle }
  747.   dbNATIVEPASSTHRUHNDL = $04040004;     { ro pBYTE    , Native passthru connection handle }
  748.   dbSERVERVERSION    = $04040005;       { ro UINT16   , Major server version number }
  749.   dbBATCHCOUNT       = $04040006;       { rw UINT16   , Batch modification count before auto-commit }
  750.   dbTRACEMODE        = $04040007;       { rw UINT16   , Trace mode }
  751.   dbCURRENTUSERNAME  = $04040008;       { rw UINT16   , Current User Name }
  752.   dbOWNERQUALIFIED   = $04040009;       { ro BOOL     , For SQL Link Drivers - does this driver support }
  753.   dbQUOTECHAR        = $0404000A;       { ro CHAR     , Quote character for quoting Object Names }
  754.   dbONLINE           = $0404000B;       { ro BOOL     , Informix ONLINE }
  755.   dbTRANALLOWED      = $0404000C;       { ro BOOL     , Informix Transactions allowed. }
  756.   dbANSI             = $0404000D;       { ro BOOL     , Informix Ansi complaint database. }
  757.   dbDBMSNAME         = $0404000E;       { ro pDBINAME , DB2 specific Database (OS/2 or MVS or AS/400). }
  758.   dbBLOBCOUNT        = $0404000F;       { ro UINT16, No.of dead BLOB to cache. }
  759.   dbBLOBSIZE         = $04040010;       { ro UINT16, Dead BLOB fetch buffer size. }
  760.  
  761.   dbSCHEMACACHEENABLED = $04040099;     { w BOOL     , TRUE - enabled/FALSE - disabled }
  762.   dbBCDENABLED       = $0404009A;       { rw BOOL , enable BCD field types. }
  763.  
  764. { Session properties }
  765. { General            }
  766.   sesMAXPROPS        = $00020000;       { ro UINT16   , Number of defined properties }
  767.   sesSESSIONNAME     = $00020001;       { ro pDBINAME , Name of seesion }
  768.   sesNETFILE         = $00020002;       { rw pCHAR    , Full filename of netfile (MAXPATHLEN) }
  769.   sesCFGMODE         = $00020003;       { rw CFGMode, Mode of configuration file. }
  770.   sesDEFAULTDRIVER   = $00020004;       { rw pDBINAME, default driver name }
  771.   sesGROUPNAME       = $00020005;       { rw pCHAR, Security - user group name (dBASE) }
  772.   sesUSERNAME        = $00020006;       { rw pCHAR, User Name }
  773.   sesUSERPASSWORD    = $00020007;       { rw pCHAR, User password }
  774.   sesSECFILENAME     = $00020008;       { rw pCHAR, Location of dBASE Security file }
  775.   sesDRNAME          = $00020009;       { rw pCHAR, Repository Database Name }
  776.   sesCFGUPDATE       = $0002000A;       { rw CFGUpdate, Mode for updating session configuration }
  777.   sesCFGNAME         = $0002000B;       { ro CFGName, get session configuration name }
  778.   sesCFGMODE2        = $0002000C;       { rw new CFGMode (persist, session, virtual) }
  779.   sesCFGRefresh      = $0002000F;       { rw, set session to refresh virtual config }
  780.   maxsesPROPS        = 13;              { keep in sync when adding session properties }
  781.  
  782. { System properties }
  783. { General           }
  784.   sysMAXPROPS        = $00010000;       { ro UINT16  , Number of defined properties }
  785.   sysLOWMEMUSAGE     = $00010001;       { ro UINT16  , Low memory usage in (k) }
  786.   maxsysPROPS        = 1;               { keep in sync when adding system properties }
  787.  
  788. { Statement properties }
  789. { General              }
  790.   stmtMAXPROPS       = $00060001;       { ro UINT16      Number of defined properties }
  791.   stmtPARAMETERCOUNT = $00060002;       { ro UINT16      Count of parameters }
  792.   stmtPARAMETERDESCS = $00060003;       { ro aFLDDesc    Array of parameters }
  793.   stmtLANGDRVNAME    = $00060004;       { ro pCHAR       Symbolic language drv. name }
  794.   stmtUNIDIRECTIONAL = $00060010;       { rw BOOL        Cursor Unidirectional }
  795.   stmtCURSORNAME     = $00060011;       { rw pCHAR       Cursor name }
  796.   stmtNEWCONNECT     = $00060012;       { rw BOOL        Stmt on new connection }
  797.   stmtNATIVEHNDL     = $00060013;       { ro pBYTE       Native statement handle }
  798.   stmtROWCOUNT       = $00060014;       { ro UINT32      Rows effected by a stmt }
  799.   stmtEXECASCURSOR   = $00060015;       { rw BOOL        Open a server cursor (ct-lib) }
  800.   maxstmtPROPS       = 32;              { keep in sync when adding ANY stmt properties }
  801.  
  802. { specific to QBE or local SQL }
  803.   stmtANSTYPE        = $00060020;       { rw pBYTE       Table Type of Answer set }
  804.   stmtLIVENESS       = $00060021;       { rw LIVENESS    Preference for canned/live answers }
  805.   stmtQRYMODE        = $00060022;       { rw QryEvalMode Execute on server or local or either }
  806.   stmtBLANKS         = $00060023;       { rw BOOL        True if blanks to be regarded as zeros. }
  807.   stmtDATEFORMAT     = $00060024;       { rw FMTDate     Date format }
  808.   stmtNUMBERFORMAT   = $00060025;       { rw FMTNumber   Number format }
  809.   stmtAUXTBLS        = $00060026;       { rw BOOL        True if QBE to create CHANGED, etc. }
  810.   stmtTBLVECTOR      = $00060027;       { ro UINT16      Vector of tables generated by query. }
  811.   stmtALLPROPS       = $00060028;       { rw QueryLowProps }
  812.   stmtALLPROPSSIZE   = $00060029;       { rw INT16       size of QueryLowProps }
  813.   stmtANSNAME        = $00060030;       { rw pBYTE       Answer Table Name. }
  814.   stmtCONSTRAINED    = $00060031;       { rw BOOL        Constrain input }
  815.   stmtFIELDDESCS     = $00060032;       { rw pFLDDESC    Answer FieldDescs }
  816.   stmtCURPROPS       = $00060033;       { rw pCURProps    Answer Curprops }
  817.   stmtDEFDBNAME      = $00060034;       { rw pCURProps    Answer Curprops }
  818.   stmtXLTMODE        = $00060035;       { rw XLTMode      Xltmode }
  819.   stmtINSTBLNAME     = $00060036;       { ro DBITBLNAME  INSERT table's name }
  820.   stmtINSERRTBLNAME  = $00060037;       { ro DBITBLNAME  ERRINS table's name }
  821.   stmtUPDTBLNAME     = $00060038;       { ro DBITBLNAME  UPDATE table's name }
  822.   stmtUPDERRTBLNAME  = $00060039;       { ro DBITBLNAME  ERRUPD table's name }
  823.   stmtDELTBLNAME     = $00060040;       { ro DBITBLNAME  DELETED table's name }
  824.   stmtDELERRTBLNAME  = $00060041;       { ro DBITBLNAME  ERRDEL table's name }
  825.   stmtCANNEDREADONLY = $00060042;       { rw BOOL canned answers are readonly }
  826.  
  827.  
  828. {============================================================================}
  829. {                    Transactions                                            }
  830. {============================================================================}
  831.  
  832. { Transaction support }
  833.  
  834. type
  835.   eXILType = (                          { Transaction isolation levels }
  836.     xilDIRTYREAD,                       { Uncommitted changes read }
  837.     xilREADCOMMITTED,                   { Committed changes, no phantoms }
  838.     xilREPEATABLEREAD                   { Full read repeatability }
  839.   );
  840.  
  841.   eXEnd = (                             { Transaction end control }
  842.     xendCOMMIT,                         { Commit transaction }
  843.     xendCOMMITKEEP,                     { Commit transaction, keep cursors }
  844.     xendABORT                           { Rollback transaction }
  845.   );
  846.  
  847.   eXState = (                           { Transaction end control }
  848.     xsINACTIVE,                         { Transaction inactive }
  849.     xsACTIVE                            { Transaction active }
  850.   );
  851.  
  852. type
  853.   pXInfo = ^XInfo;
  854.   XInfo = packed record
  855.     exState         : eXState;          { xsActive, xsInactive }
  856.     eXIL            : eXILType;         { Xact isolation level }
  857.     uNests          : Word;             { Xact children }
  858.   end;
  859.  
  860.  
  861. {============================================================================}
  862. {                         BookMark compares                                  }
  863. {============================================================================}
  864.  
  865. type
  866.   PCMPBkMkRslt = ^CMPBkMkRslt;
  867.   CMPBkMkRslt = TypedEnum;
  868. const
  869.     CMPLess           = -1;             { Bkm1 < Bkm2 }
  870.     CMPEql            = 0;              { BookMarks are exactly the same }
  871.     CMPGtr            = 1;              { Bkm1 > Bkm2 }
  872.     CMPKeyEql         = 2;              { Only Bkm1.key_val = Bkm2.key_val }
  873.  
  874. {============================================================================}
  875. {                             Key searches                                   }
  876. {============================================================================}
  877.  
  878. type
  879.   DBISearchCond = (                     { Search condition for keys }
  880.     keySEARCHEQ,                        { = }
  881.     keySEARCHGT,                        { > }
  882.     keySEARCHGEQ                        { >= }
  883.   );
  884.  
  885. {============================================================================}
  886. {                      Create/Restructure descriptor                         }
  887. {============================================================================}
  888.  
  889. type
  890.   pCROpType          = ^CROpType;
  891.   CROpType = (                          { Create/Restruct Operation type }
  892.     crNOOP,
  893.     crADD,                              { Add a new element. }
  894.     crCOPY,                             { Copy an existing element. }
  895.     crMODIFY,                           { Modify an element. }
  896.     crDROP,                             { Removes an element. }
  897.     crREDO,                             { Reconstruct an element. }
  898.     crTABLE,                            { Not used }
  899.     crGROUP,                            { Not used }
  900.     crFAMILY,                           { Not used }
  901.     crDONE,                             { Used internally }
  902.     crDROPADD                           { Used internally }
  903.   );
  904.  
  905. type
  906.   pCRTblDesc         = ^CRTblDesc;
  907.   CRTblDesc = packed record             { Create/Restruct Table descr }
  908.     szTblName       : DBITBLNAME;       { TableName incl. optional path & ext }
  909.     szTblType       : DBINAME;          { Driver type (optional) }
  910.     szErrTblName    : DBIPATH;          { Error Table name (optional) }
  911.     szUserName      : DBINAME;          { User name (if applicable) }
  912.     szPassword      : DBINAME;          { Password (optional) }
  913.     bProtected      : WordBool;         { Master password supplied in szPassword }
  914.     bPack           : WordBool;         { Pack table (restructure only) }
  915.     iFldCount       : Word;             { Number of field defs supplied }
  916.     pecrFldOp       : pCROpType;        { Array of field ops }
  917.     pfldDesc        : pFLDDesc;         { Array of field descriptors }
  918.     iIdxCount       : Word;             { Number of index defs supplied }
  919.     pecrIdxOp       : pCROpType;        { Array of index ops }
  920.     pidxDesc        : PIDXDesc;         { Array of index descriptors }
  921.     iSecRecCount    : Word;             { Number of security defs supplied }
  922.     pecrSecOp       : pCROpType;        { Array of security ops }
  923.     psecDesc        : pSECDesc;         { Array of security descriptors }
  924.     iValChkCount    : Word;             { Number of val checks }
  925.     pecrValChkOp    : pCROpType;        { Array of val check ops }
  926.     pvchkDesc       : pVCHKDesc;        { Array of val check descs }
  927.     iRintCount      : Word;             { Number of ref int specs }
  928.     pecrRintOp      : pCROpType;        { Array of ref int ops }
  929.     printDesc       : pRINTDesc;        { Array of ref int specs }
  930.     iOptParams      : Word;             { Number of optional parameters }
  931.     pfldOptParams   : pFLDDesc;         { Array of field descriptors }
  932.     pOptData        : Pointer;          { Optional parameters }
  933.   end;
  934.  
  935. {============================================================================}
  936. {                      Batch                                                 }
  937. {============================================================================}
  938.  
  939. type
  940.   pBATTblDesc        = ^BATTblDesc;
  941.   BATTblDesc = packed record            { Batch Table definition struct }
  942.     hDb             : hDBIDb;           { Database }
  943.     szTblName       : DBIPATH;          { Table name }
  944.     szTblType       : DBINAME;          { Optional Driver type }
  945.     szUserName      : DBINAME;          { Optional User name }
  946.     szPassword      : DBINAME;          { Optional Pass word }
  947.   end;
  948.  
  949.   eBATMode = (                          { Batch mode for DBIBatchMove }
  950.     batchAPPEND,
  951.     batchUPDATE,
  952.     batchAPPENDUPDATE,
  953.     batchSUBTRACT,
  954.     batchCOPY
  955.   );
  956.  
  957. type
  958.   pSORTOrder         = ^SORTOrder;
  959.   SORTOrder = (                         { Sort Order }
  960.     sortASCEND,                         { ascending (default) }
  961.     sortDESCEND                         { descending }
  962.   );
  963.  
  964.   ppfSORTCompFn = ^pfSORTCompFn;
  965.   pfSORTCompFn = function (             { pntr to client compare fn }
  966. var   LdObj         : Pointer;          { Language driver, if needed }
  967. var   Value1        : Pointer;          { first value }
  968. var   Value2        : Pointer;          { second value }
  969.       iLen          : SmallInt              { Length, if needed }
  970.    ): SmallInt;
  971.  
  972.       { Returns: -1 if (Value 1 < Value 2),  }
  973.       {           0 if (Value 1 == Value 2), }
  974.       {          +1 if (Value 1 > Value 2)   }
  975.  
  976. {============================================================================}
  977. {                       Types/Structs for Capabilities                       }
  978. {============================================================================}
  979.  
  980. type
  981.   DRVCat = (                            { Driver Category }
  982.     drvFILLER,                          { Filler to make next start at 1 }
  983.     drvFILE,                            { File based (Paradox, xBASE) }
  984.     drvOTHERSERVER,                     { Other kind of server (IMS ?) }
  985.     drvSQLBASEDSERVER,                  { SQL Based Server }
  986.     drvOLEDBPROVIDER                    { OLE DB Provider }
  987.   );
  988.  
  989.   OPType = (                            { Config info & Optional Parameters }
  990.     opFILLER0,                          { Filler to make first one 3 }
  991.     opFILLER1,                          { Filler to make first one 3 }
  992.     opFILLER2,                          { Filler to make first one 3 }
  993.     opDBCREATE,
  994.     opDBOPEN,
  995.     opTBLCREATE,
  996.     opTBLOPEN
  997.   );
  998.  
  999. type
  1000.   pDRVType = ^DRVType;
  1001.   DRVType = packed record               { Driver Description/Capabilities }
  1002.     szType          : DBINAME;          { Symbolic name to identify }
  1003.     szText          : DBINAME;          { Descriptive text }
  1004.     edrvCat         : DRVCat;           { Driver category }
  1005.     bTrueDb         : WordBool;         { Supports True Db concept }
  1006.     szDbType        : DBINAME;          { Db Type to be used }
  1007.     bMultiUser      : WordBool;         { Supports Multi-user access }
  1008.     bReadWrite      : WordBool;         { Read Write or Read-only }
  1009.     bTrans          : WordBool;         { Supports Transactions }
  1010.     bPassThruSQL    : WordBool;         { Supports Pass-thru SQL }
  1011.     bLogIn          : WordBool;         { Requires explicit login }
  1012.     bCreateDb       : WordBool;         { Can reate a Database }
  1013.     bDeleteDb       : WordBool;         { Can drop database }
  1014.     bCreateTable    : WordBool;         { Can create a Table }
  1015.     bDeleteTable    : WordBool;         { Can delete a Table }
  1016.     bMultiplePWs    : WordBool;         { Multiple passwords }
  1017.     iDriverVersion  : Word;             { Driver version 1..n }
  1018.     bSQLRowid       : WordBool;         { Supports SQL rowid }
  1019.     iUnUsed         : packed array [0..14] of Word;
  1020.   end;
  1021.  
  1022.  
  1023.   pTBLType = ^TBLType;
  1024.   TBLType = packed record               { Table Capabilities }
  1025.     iId             : Word;             { Id of Table Type }
  1026.     szName          : DBINAME;          { Symbolic name; eg "dBASE" }
  1027.     szText          : DBINAME;          { Descriptive text }
  1028.     szFormat        : DBINAME;          { Format; eg "HEAP" }
  1029.     bReadWrite      : WordBool;         { User can Read/Write }
  1030.     bCreate         : WordBool;         { Can create new tables }
  1031.     bRestructure    : WordBool;         { Can restructure this table }
  1032.     bValChecks      : WordBool;         { Val Checks can be specified }
  1033.     bSecurity       : WordBool;         { Can be protected }
  1034.     bRefIntegrity   : WordBool;         { Can participate in ref integrity }
  1035.     bPrimaryKey     : WordBool;         { Supports primary key concept }
  1036.     bIndexing       : WordBool;         { Can have other indexes }
  1037.     iFldTypes       : Word;             { Number of Phy Field types supported }
  1038.     iMaxRecSize     : Word;             { Max record size }
  1039.     iMaxFldsInTable : Word;             { Max fields in a table }
  1040.     iMaxFldNameLen  : Word;             { Maximum field name length }
  1041.     iTblLevel       : Word;             { Driver dependent table level (version) }
  1042.     iUnUsed         : packed array [0..15] of Word;
  1043.   end;
  1044.  
  1045.  
  1046.   pIDXType = ^IDXType;
  1047.   IDXType = packed record
  1048.     iId             : Word;             { Id of Index Type }
  1049.     szName          : DBINAME;          { Symbolic name }
  1050.     szText          : DBINAME;          { Descriptive text }
  1051.     szFormat        : DBINAME;          { Optional format(BTREE, HASH etc) }
  1052.     bComposite      : WordBool;         { Supports composite keys }
  1053.     bPrimary        : WordBool;         { True, if primary index }
  1054.     bUnique         : WordBool;         { True, No duplicates supported }
  1055.     bKeyDescending  : WordBool;         { If whole key can be descending }
  1056.     bFldDescending  : WordBool;         { Field level descending }
  1057.     bMaintained     : WordBool;         { Supports maintained option }
  1058.     bSubset         : WordBool;         { Supports Subset expression }
  1059.     bKeyExpr        : WordBool;         { If Key can be expres }
  1060.     bCaseInsensitive : WordBool;        { Supports Caseinsensitive indexes }
  1061.     iUnUsed         : packed array [0..15] of Word;
  1062.   end;
  1063.  
  1064.   pFLDType = ^FLDType;
  1065.   FLDType = packed record
  1066.     iId             : Word;             { Id of Field Type }
  1067.     szName          : DBINAME;          { Symbolic name; eg "ALPHA" }
  1068.     szText          : DBINAME;          { Descriptive text }
  1069.     iPhyType        : Word;             { Physical/Native type }
  1070.     iXltType        : Word;             { Default xlated type }
  1071.     iXltSubType     : Word;             { Default xlated sub type }
  1072.     iMaxUnits1      : Word;             { Max units allowed (1) }
  1073.     iMaxUnits2      : Word;             { Max units allowed (2) }
  1074.     iPhySize        : Word;             { Physical size in bytes (per unit) }
  1075.     bRequired       : WordBool;         { Supports 'required' option }
  1076.     bDefaultVal     : WordBool;         { Supports user specified 'default' }
  1077.     bMinVal         : WordBool;         { Supports MIN Val constraint }
  1078.     bMaxVal         : WordBool;         { Supports MAX Val constraint }
  1079.     bRefIntegrity   : WordBool;         { Can participate in ref integrity }
  1080.     bOtherChecks    : WordBool;         { Supports other kinds of checks }
  1081.     bKeyed          : WordBool;         { The field type can be keyed }
  1082.     bMultiplePerTable : WordBool;       { Table can have more than 1 of this type }
  1083.     iMinUnits1      : Word;             { Min units required (1) }
  1084.     iMinUnits2      : Word;             { Min units required (2) }
  1085.     bCreateable     : WordBool;         { Type can be created }
  1086.     szNativeName    : DBINAME;          { Native (SQL) name used in DDL }
  1087.     iUnUsed         : packed array [0..15] of Word;
  1088.   end;
  1089.  
  1090.   PROPValid = (                         { PROP Validity }
  1091.     epropINVALID,                       { Property is INVALID (not supported) }
  1092.     epropCANGET,                        { You can GET value of the property }
  1093.     epropCANSET                         { You can GET and SET value of the property }
  1094.   );
  1095.  
  1096. {============================================================================}
  1097. {                                Call Backs                                  }
  1098. {============================================================================}
  1099.  
  1100. type
  1101.   pCBType            = ^CBType;
  1102.   CBType = (                            { Call back type }
  1103.     cbGENERAL,                          { General purpose }
  1104.     cbRESERVED1,
  1105.     cbRESERVED2,
  1106.     cbINPUTREQ,                         { Input requested }
  1107.     cbRESERVED4,
  1108.     cbRESERVED5,
  1109.     cbBATCHRESULT,                      { Batch processing rslts }
  1110.     cbRESERVED7,
  1111.     cbRESTRUCTURE,                      { Restructure }
  1112.     cbRESERVED9,
  1113.     cbRESERVED10,
  1114.     cbRESERVED11,
  1115.     cbRESERVED12,
  1116.     cbRESERVED13,
  1117.     cbRESERVED14,
  1118.     cbRESERVED15,
  1119.     cbRESERVED16,
  1120.     cbRESERVED17,
  1121.     cbTABLECHANGED,                     { Table changed notification }
  1122.     cbRESERVED19,
  1123.     cbCANCELQRY,                        { Allow user to cancel Query }
  1124.     cbSERVERCALL,                       { Server Call }
  1125.     cbRESERVED22,
  1126.     cbGENPROGRESS,                      { Generic Progress report. }
  1127.     cbDBASELOGIN,                       { dBASE Login }
  1128.     cbDELAYEDUPD,                       { Delayed Updates }
  1129.     cbFIELDRECALC,                      { Field(s) recalculation }
  1130.     cbTRACE,                            { Trace }
  1131.     cbDBLOGIN,                          { Database login }
  1132.     cbDETACHNOTIFY,                     { DLL Detach Notification }
  1133.     cbNBROFCBS                          { Number of cbs }
  1134.   );
  1135.  
  1136. const
  1137.   cbYIELDCLIENT = cbCANCELQRY;
  1138.  
  1139. type
  1140.   pCBRType           = ^CBRType;
  1141.   CBRType = (                           { Call-back return type }
  1142.     cbrUSEDEF,                          { Take default action }
  1143.     cbrCONTINUE,                        { Continue }
  1144.     cbrABORT,                           { Abort the operation }
  1145.     cbrCHKINPUT,                        { Input given }
  1146.     cbrYES,                             { Take requested action }
  1147.     cbrNO,                              { Do not take requested action }
  1148.     cbrPARTIALASSIST,                   { Assist in completing the job }
  1149.     cbrSKIP,                            { Skip this operation }
  1150.     cbrRETRY                            { Retry this operation }
  1151.   );
  1152.  
  1153.   ppfDBICallBack = ^pfDBICallBack;
  1154.   pfDBICallBack  = function (           { Call-back funtion pntr type }
  1155.       ecbType       : CBType;           { Callback type }
  1156.       iClientData   : Longint;          { Client callback data }
  1157.       CbInfo        : Pointer           { Call back info/Client Input }
  1158.    ): CBRType stdcall;
  1159.  
  1160. { Progress callback structure }
  1161.  
  1162.   pCBPROGRESSDesc = ^CBPROGRESSDesc;
  1163.   CBPROGRESSDesc  = packed record
  1164.     iPercentDone    : SmallInt;         { Percentage done. }
  1165.     szMsg           : DBIMSG;           { Message to display }
  1166.   end;
  1167.  
  1168.   DelayUpdErrOpType = (                 { type of delayed update object (delayed updates callback) }
  1169.     delayupdNONE,
  1170.     delayupdMODIFY,
  1171.     delayupdINSERT,
  1172.     delayupdDELETE
  1173.   );
  1174.  
  1175.   PDELAYUPDCbDesc = ^DELAYUPDCbDesc;
  1176.   DELAYUPDCbDesc = packed record        { delayed updates callback info }
  1177.     iErrCode        : DBIResult;
  1178.     eDelayUpdOpType : DelayUpdErrOpType;
  1179.     iRecBufSize     : Word;             { Record size (physical record) }
  1180.     pNewRecBuf      : Pointer;
  1181.     pOldRecBuf      : Pointer;
  1182.   end;
  1183.  
  1184.   RESTErrObjType = (                    { type of restructure object (restructure callback) }
  1185.     restrNONE,
  1186.     restrNEWFLD,
  1187.     restrOLDFLD,
  1188.     restrNEWINDEX,
  1189.     restrOLDINDEX,
  1190.     restrNEWVCHK,
  1191.     restrOLDVCHK,
  1192.     restrNEWRINT,
  1193.     restrOLDRINT,
  1194.     restrNEWSEC,
  1195.     restrOLDSEC,
  1196.     restrNEWTABLE
  1197.   );
  1198.  
  1199.   pCBDBLogin = ^TCBDBLogin;
  1200.   TCBDBLogin = packed record            { Database login }
  1201.     szDbName        : DBINAME;          { Database name }
  1202.     eOpenMode       : DBIOpenMode;      { Open type desired }
  1203.     eShareMode      : DBIShareMode;     { Share type desired }
  1204.     szPassword      : DBINAME;          { Password }
  1205.     bCallbackToClose : Bool;            { Returned flag }
  1206.     hDb             : hDBIDb;           { db handle }
  1207.   end;
  1208.  
  1209. type
  1210.   pTRACECat = ^TRACECat;                { trace categories }
  1211.   TRACECat = TypedEnum;
  1212. const
  1213.     traceUNKNOWN   = $0000;
  1214.     traceQPREPARE  = $0001;             { prepared query statements }
  1215.     traceQEXECUTE  = $0002;             { executed query statements }
  1216.     traceERROR     = $0004;             { vendor errors }
  1217.     traceSTMT      = $0008;             { statement ops (i.e. allocate, free) }
  1218.     traceCONNECT   = $0010;             { connect / disconnect }
  1219.     traceTRANSACT  = $0020;             { transaction }
  1220.     traceBLOB      = $0040;             { blob i/o }
  1221.     traceMISC      = $0080;             { misc. }
  1222.     traceVENDOR    = $0100;             { vendor calls }
  1223.     traceDATAIN    = $0200;             { parameter bound data }
  1224.     traceDATAOUT   = $0400;             { trace fetched data }
  1225.  
  1226. type
  1227.   pTRACEDesc = ^TRACEDesc;
  1228.   TRACEDesc = packed record             { trace callback info }
  1229.     eTraceCat       : TRACECat;
  1230.     uTotalMsgLen    : Word;
  1231.     pszTrace        : array [0..0] of Char;
  1232.   end;
  1233.  
  1234. type
  1235.   TuObjDesc = packed record
  1236.     case Integer of
  1237.       1: (fldDesc:  FLDDesc);
  1238.       2: (idxDesc:  IDXDesc);
  1239.       3: (vchkDesc: VCHKDesc);
  1240.       4: (rintDesc: RINTDesc);
  1241.       5: (secDesc:  SECDesc);
  1242.   end;
  1243.  
  1244.   RESTCbDesc = packed record            { restructure callback info }
  1245.     iErrCode        : DBIResult;
  1246.     iTblNum         : Word;
  1247.     iObjNum         : Word;
  1248.     eRestrObjType   : RESTErrObjType;
  1249.     uObjDesc        : TuObjDesc;
  1250.   end;
  1251.  
  1252.   CBEntry = packed record
  1253.     szKeyWord       : DBINAME;          { Keyword to display }
  1254.     szHelp          : DBIMSG;           { Help String }
  1255.   end;
  1256.  
  1257. const
  1258.   MAXCBENTRIES       = 4;
  1259.  
  1260. type
  1261.   CBInputId = (
  1262.     cbiFILLER,                          { Force next to start at 1 }
  1263.     cbiMDXMISSING,                      { MDX file missing request }
  1264.     cbiPDXLOOKUP,                       { Lookup table missing }
  1265.     cbiPDXBLOB,                         { Blob file missing }
  1266.     cbiDBTMISSING,                      { DBT file missing request }
  1267.     cbiDRINPUT,                         { DR Manager needs user input }
  1268.     cbiRINTMISSING                      { RefInt link missing/corrupt }
  1269.   );
  1270.  
  1271.   PCBInputDesc = ^CBInputDesc;
  1272.   CBInputDesc = packed record
  1273.     eCbInputId      : CBInputId;        { Id for this input request }
  1274.     iCount          : SmallInt;         { Number of entries }
  1275.     iSelection      : SmallInt;         { Selection 1..n  (In/Out) }
  1276.     bSave           : WordBool;         { Save this option  (In/Out) }
  1277.     szMsg           : DBIMSG;           { Message to display }
  1278.     acbEntry        : packed array [0..MAXCBENTRIES-1] of CBEntry; { Entries }
  1279.   end;
  1280.  
  1281.   pCBLoginDesc = ^CBLoginDesc;
  1282.   CBLoginDesc  = packed record          { dBASE login callback structure }
  1283.     szUserName      : DBINAME;          { Login name of user }
  1284.     szGroupName     : DBINAME;          { Group to log in to }
  1285.     szUserPassword  : DBINAME;          { User password }
  1286.   end;
  1287.  
  1288. { cbSERVERCALL info }
  1289.  
  1290.   PCBSCType = ^CBSCType;
  1291.   CBSCType = (                             { Server call type }
  1292.     cbscRETURN,                            { Return from a call }
  1293.     cbscSQL                                { SQL server call }
  1294.   );
  1295.  
  1296. { cbYIELDCLIENT }
  1297.  
  1298.   PCBYieldStep = ^CBYieldStep;
  1299.   CBYieldStep = (
  1300.     cbYieldFirst,
  1301.     cbYieldContinue,
  1302.     cbYieldLast
  1303.   );
  1304.  
  1305. {============================================================================}
  1306. {                         Basic Query Types                                  }
  1307. {============================================================================}
  1308.  
  1309. type
  1310.   DBIQryLang = (
  1311.     qrylangUNKNOWN,                     { UNKNOWN (Error) }
  1312.     qrylangQBE,                         { QBE }
  1313.     qrylangSQL                          { SQL }
  1314.   );
  1315.  
  1316. {============================================================================}
  1317. {                         Statement parameter information                    }
  1318. {============================================================================}
  1319.  
  1320. type
  1321.   eINDValues = TypedEnum;
  1322. const
  1323.     indTRUNC     = -2;                   { Value has been truncated }
  1324.     indNULL      = -1;                   { Value is NULL }
  1325.     indVALUE     = 1;
  1326.  
  1327. const
  1328.   INDLEN             = sizeof(Word);
  1329.  
  1330. type
  1331.   STMTParamType = (
  1332.     paramUNKNOWN,                       { UNKNOWN (Error) }
  1333.     paramIN,                            { Input parameter }
  1334.     paramOUT,                           { Output parameter }
  1335.     paramINOUT,                         { Input/Output parameter }
  1336.     paramRET                            { Procedure (or function) return }
  1337.   );
  1338.  
  1339.   STMTParamFormat = (
  1340.     paramfmtUNKNOWN,                    { UNKNOWN (Error) }
  1341.     paramfmtNUMBER,                     { Numbered parameter markers of the form ? or :n }
  1342.     paramfmtNAME                        { Named parameters markers of the form :name }
  1343.   );
  1344.  
  1345. {============================================================================}
  1346. {                         Properties For DbiQPrepareExt                      }
  1347. {============================================================================}
  1348.  
  1349. const
  1350.   qprepNONE          = 0;               { like DbiQPrepare }
  1351.   qprepFORUPDATE     = $1;              { do extra work, anticipating UPDATE WHERE CURRENT }
  1352.  
  1353.  
  1354. {============================================================================}
  1355. {                      Date, Time, Number Formats                            }
  1356. {============================================================================}
  1357.  
  1358. type
  1359.   pFMTNumber = ^FMTNumber;
  1360.   FMTNumber = packed record             { Date Format }
  1361.     cDecimalSeparator : Char;           { Default "." }
  1362.     cThousandSeparator : Char;          { Default "," }
  1363.     iDecimalDigits  : Byte;             { Default 2 }
  1364.     bLeadingZero    : Boolean;          { Default TRUE. }
  1365.   end;
  1366.  
  1367.   pFMTDate = ^FMTDate;
  1368.   FMTDate = packed record
  1369.     szDateSeparator : packed array [0..3] of Char;    { Default "/" }
  1370.     iDateMode       : Byte;            { 0 = MDY (Def), 1 = DMY, 2 = YMD }
  1371.     bFourDigitYear  : Boolean;         { Write Year as 4 digits (FALSE) }
  1372.     bYearBiased     : Boolean;         { On input add 1900 to year (TRUE) }
  1373.     bMonthLeadingZero : Boolean;       { Month with Leading Zero (TRUE) }
  1374.     bDayLeadingZero : Boolean;         { Day with Leading Zero (TRUE) }
  1375.   end;
  1376.  
  1377.   pFMTTime = ^FMTTime;
  1378.   FMTTime = packed record
  1379.     cTimeSeparator  : Char;             { Default ":" }
  1380.     bTwelveHour     : Boolean;          { Represent as 12 Hour time (FALSE) }
  1381.     szAmString      : packed array [0..5] of Char;    { Default Null (Only for 12 Hr) }
  1382.     szPmString      : packed array [0..5] of Char;    { Default Null (Only for 12 Hr) }
  1383.     bSeconds        : Boolean;          { Show Seconds (TRUE) }
  1384.     bMilSeconds     : Boolean;          { Show Milli Seconds (FALSE) }
  1385.   end;
  1386.  
  1387.   pFMTBcd = ^FMTBcd;
  1388.   FMTBcd  = packed record
  1389.     iPrecision      : Byte;             { 1..64 considered valid }
  1390.     iSignSpecialPlaces : Byte;          { sign:1, special:1, places:6 }
  1391.     iFraction       : packed array [0..31] of Byte;    { bcd nibbles, 00..99 per byte, high nibble 1st }
  1392.   end;
  1393.  
  1394.  
  1395. {============================================================================}
  1396. {                              Error Info                                    }
  1397. {============================================================================}
  1398.  
  1399. type
  1400.   pDBIErrInfo        = ^DBIErrInfo;
  1401.   DBIErrInfo = packed record            { Error info }
  1402.     iError          : DBIResult;        { Last error code returned }
  1403.     szErrCode       : DBIMSG;           { Error Code }
  1404.     szContext       : packed array[1..4] of DBIMSG;    { Context info }
  1405.   end;
  1406.  
  1407. { Error contexts (To be used with DbiGetErrorContext) }
  1408.  
  1409. const
  1410.   ecTOKEN            = 1;               { Token (For QBE) }
  1411.   ecTABLENAME        = 3;               { Table name }
  1412.   ecFIELDNAME        = 4;               { Field Name }
  1413.   ecIMAGEROW         = 5;               { Image Row (For QBE) }
  1414.   ecUSERNAME         = 6;               { eg, In lock conflicts, user involved }
  1415.   ecFILENAME         = 7;               { File Name }
  1416.   ecINDEXNAME        = 8;               { Index Name }
  1417.   ecDIRNAME          = 9;               { Directory Name }
  1418.   ecKEYNAME          = 10;              { Key Name }
  1419.   ecALIAS            = 11;              { Alias }
  1420.   ecDRIVENAME        = 12;              { Drive name ('c:') }
  1421.   ecNATIVECODE       = 13;              { Native error code }
  1422.   ecNATIVEMSG        = 14;              { Native error message }
  1423.   ecLINENUMBER       = 15;              { Line Number }
  1424.   ecCAPABILITY       = 16;              { Capability }
  1425.   ecCDRNAME          = 17;              { Client Data Repository Name }
  1426.   ecUSERERRMSG       = 18;              { User Defined error msg }
  1427.   ecDROBJNAME        = 19;              { Data Repository Object Name }
  1428.   ecINTERNALLIMIT    = 20;              { Internal limit }
  1429.   ecEXPRESSION       = 21;              { SQL Expression }
  1430.  
  1431. {============================================================================}
  1432. {                  Schema info structures                                    }
  1433. {============================================================================}
  1434. {                    Database descriptor                                     }
  1435. {============================================================================}
  1436.  
  1437.  
  1438. { DbiOpenDatabaseList }
  1439. type
  1440.   pDBDesc = ^DBDesc;
  1441.   DBDesc = packed record                { A given Database Description }
  1442.     szName          : DBINAME;          { Logical name (Or alias) }
  1443.     szText          : DBINAME;          { Descriptive text }
  1444.     szPhyName       : DBIPATH;          { Physical name/path }
  1445.     szDbType        : DBINAME;          { Database type }
  1446.   end;
  1447.  
  1448.  
  1449. {============================================================================}
  1450. {                    User info descriptor                                    }
  1451. {============================================================================}
  1452.  
  1453.  
  1454. { DbiOpenUserList }
  1455. type
  1456.   pUSERDesc = ^USERDesc;
  1457.   USERDesc = packed record              { User description }
  1458.     szUserName      : DBIUSERNAME;
  1459.     iNetSession     : Word;             { Net level session number }
  1460.     iProductClass   : Word;             { Product class of user }
  1461.     szSerialNum     : packed array [0..21] of Char; { Serial number }
  1462.   end;
  1463.  
  1464. {============================================================================}
  1465. {                    Table descriptor                                        }
  1466. {============================================================================}
  1467.  
  1468.  
  1469. { DbiOpenTableList }
  1470. type
  1471.   pTBLBaseDesc = ^TBLBaseDesc;
  1472.   TBLBaseDesc = packed record           { Table description (Base) }
  1473.     szName          : DBITBLNAME;       { Table name(No extension or Dir) }
  1474.     szFileName      : DBITBLNAME;       { File name }
  1475.     szExt           : DBIEXT;           { File extension }
  1476.     szType          : DBINAME;          { Driver type }
  1477.     dtDate          : DBIDATE;          { Date on the table }
  1478.     tmTime          : Time;             { Time on the table }
  1479.     iSize           : Longint;          { Size in bytes }
  1480.     bView           : WordBool;         { If this a view }
  1481.     bSynonym        : WordBool;         { If this is a synonym }
  1482.   end;
  1483.  
  1484.   pTBLExtDesc = ^TBLExtDesc;
  1485.   TBLExtDesc = packed record            { Table description (Extended part) }
  1486.     szStruct        : DBINAME;          { Physical structure }
  1487.     iRestrVersion   : Word;             { Version # }
  1488.     iRecSize        : Word;             { Physical record size }
  1489.     iFields         : Word;             { Number of fields }
  1490.     iIndexes        : Word;             { Number Indexes }
  1491.     iValChecks      : Word;             { Number of field validity checks }
  1492.     iRintChecks     : Word;             { Number of ref. integrity checks }
  1493.     iRecords        : Longint;          { Number of records in table }
  1494.     bProtected      : WordBool;         { If the table is prot }
  1495.     bValidInfo      : WordBool;         { Info available for this table }
  1496.   end;
  1497.  
  1498.   pTBLFullDesc = ^TBLFullDesc;
  1499.   TBLFullDesc = packed record           { Table description (Base + Ext) }
  1500.     tblBase         : TBLBaseDesc;      { Base      description }
  1501.     tblExt          : TBLExtDesc;       { Extended  description }
  1502.   end;
  1503.  
  1504. {============================================================================}
  1505. {                    File descriptor                                         }
  1506. {============================================================================}
  1507.  
  1508.  
  1509. { DbiOpenFileList }
  1510. type
  1511.   pFILEDesc = ^FILEDesc;
  1512.   FILEDesc = packed record              { File description }
  1513.     szFileName      : DBIPATH;          { File name (No Dir or ext) }
  1514.     szExt           : DBIEXT;           { Extension }
  1515.     bDir            : WordBool;         { True, if directory }
  1516.     iSize           : Longint;          { File size in bytes }
  1517.     dtDate          : DBIDATE;          { Date on the file }
  1518.     tmTime          : Time;             { Time on the file }
  1519.   end;
  1520.  
  1521. {======================================================================}
  1522. {            Stored Procedure and Stored Procedure Param descriptor    }
  1523. {======================================================================}
  1524.  
  1525. type
  1526.   pSPDesc = ^SPDesc;
  1527.   SPDesc = packed record
  1528.     szName          : DBISPNAME;
  1529.     dtDate          : DBIDATE;
  1530.     tmTime          : Time;
  1531.   end;
  1532.  
  1533.   pSPParamDesc = ^SPParamDesc;
  1534.   SPParamDesc = packed record
  1535.     uParamNum       : Word;
  1536.     szName          : DBINAME;
  1537.     eParamType      : STMTParamType;
  1538.     uFldType        : Word;
  1539.     uSubType        : Word;
  1540.     iUnits1         : SmallInt;
  1541.     iUnits2         : SmallInt;
  1542.     uOffset         : Word;
  1543.     uLen            : Word;
  1544.     uNullOffset     : Word;
  1545.   end;
  1546.  
  1547. {======================================================================}
  1548. {            Function and Function Argument Descriptors                }
  1549. {======================================================================}
  1550.  
  1551. type
  1552.   DBISTDFuncs = (
  1553.     fnAVG,
  1554.     fnCOUNT,
  1555.     fnMIN,
  1556.     fnMAX,
  1557.     fnSUM,
  1558.     fnSTDDEV,
  1559.     fnVARIANCE,
  1560.     fnABS,
  1561.     fnCEIL,
  1562.     fnCOS,
  1563.     fnCOSH,
  1564.     fnEXP,
  1565.     fnFLOOR,
  1566.     fnLN,
  1567.     fnLOG,
  1568.     fnMOD,
  1569.     fnPOWER,
  1570.     fnROUND,
  1571.     fnSIGN,
  1572.     fnSIN,
  1573.     fnSINH,
  1574.     fnSQRT,
  1575.     fnTAN,
  1576.     fnTANH,
  1577.     fnTRUNC,
  1578.     fnCHR,
  1579.     fnCONCAT,
  1580.     fnINITCAP,
  1581.     fnLOWER,
  1582.     fnLPAD,
  1583.     fnLTRIM,
  1584.     fnNLS_INITCAP,
  1585.     fnNLS_LOWER,
  1586.     fnNLS_UPPER,
  1587.     fnREPLACE,
  1588.     fnRPAD,
  1589.     fnRTRIM,
  1590.     fnSOUNDEX,
  1591.     fnSUBSTR,
  1592.     fnSUBSTRB,
  1593.     fnTRANSLATE,
  1594.     fnUPPER,
  1595.     fnASCII,
  1596.     fnINSTR,
  1597.     fnINSTRB,
  1598.     fnLENGTH,
  1599.     fnLENGTHB,
  1600.     fnNLSSORT,
  1601.     fnADD_MONTHS,
  1602.     fnLAST_DAY,
  1603.     fnMONTHS_BETWEEN,
  1604.     fnNEW_TIME,
  1605.     fnNEXT_DAY,
  1606.     fnSYSDATE,
  1607.     fnCONVERT,
  1608.     fnTO_CHAR,
  1609.     fnTO_DATE,
  1610.     fnTO_MULTI_BYTE,
  1611.     fnTO_NUMBER,
  1612.     fnTO_SINGLE_BYTE,
  1613.     fnUID,
  1614.     fnUSER,
  1615.     fnORACLEMISC,
  1616.     fnACOS,
  1617.     fnASIN,
  1618.     fnATAN,
  1619.     fnATN2,
  1620.     fnCOT,
  1621.     fnDEGREES,
  1622.     fnLOG10,
  1623.     fnPI,
  1624.     fnRADIANS,
  1625.     fnRAND,
  1626.     fnTEXTPTR,
  1627.     fnTEXTVALID,
  1628.     fnCHARINDEX,
  1629.     fnDIFFERENCE,
  1630.     fnPATINDEX,
  1631.     fnREPLICATE,
  1632.     fnREVERSE,
  1633.     fnRIGHT,
  1634.     fnSPACE,
  1635.     fnSTR,
  1636.     fnSTUFF,
  1637.     fnCOL_NAME,
  1638.     fnCOL_LENGTH,
  1639.     fnDATALENGTH,
  1640.     fnDB_ID,
  1641.     fnDB_NAME,
  1642.     fnHOST_ID,
  1643.     fnHOST_NAME,
  1644.     fnINDEX_COL,
  1645.     fnOBJECT_ID,
  1646.     fnOBJECT_NAME,
  1647.     fnUSER_ID,
  1648.     fnUSER_NAME,
  1649.     fnLEFT,
  1650.     fnLOCATE,
  1651.     fnTRUNCATE,
  1652.     fnCURTIME,
  1653.     fnDAYNAME,
  1654.     fnDAYOFMONTH,
  1655.     fnDAYOFWEEK,
  1656.     fnDAYOFYEAR,
  1657.     fnHOUR,
  1658.     fnMINUTE,
  1659.     fnMONTH,
  1660.     fnMONTHNAME,
  1661.     fnNOW,
  1662.     fnQUARTER,
  1663.     fnSECOND,
  1664.     fnWEEK,
  1665.     fnYEAR,
  1666.     fnDAY,
  1667.     fnWEEKDAY,
  1668.     fnTODAY,
  1669.     fnDATE,
  1670.     fnINFMISC
  1671.   );
  1672.  
  1673. type
  1674.   DBIFuncFlags = TypedEnum;
  1675.  
  1676. const
  1677.   fnSCALARS_ALLOW_CONSTANTS           = $0001;    { fn args may contain refeences to constants |
  1678.   fnSCALARS_ALLOW_COLUMNS             = $0002;    { fn args may contain refeences to columns }
  1679.   fnSCALARS_ALLOW_PARAMETERS          = $0004;    { fn args may contain refeences to parameters }
  1680.   fnSCALARS_ALLOW_FUNCTIONS           = $0008;    { fn args may contain refeences to functions }
  1681.   fnSCALARS_ALLOW_USER_DEFINED_FUNCS  = $0010;    { fn args may contain refeences to user defined functions }
  1682.   fnSCALARS_ALLOW_SUBQUERIES          = $0020;    { fn args can contain subqueries }
  1683.   fnSCALARS_ALLOW_CORRELATION         = $0040;    { fn subqueries can be correlated }
  1684.  
  1685. type
  1686.   DBIFUNCOpts = (
  1687.     fnDummy,
  1688.     fnListINCL_USER_DEF                 { include user-defined functions }
  1689.   );
  1690.  
  1691.   pDBIFUNCDesc = ^DBIFUNCDesc;
  1692.   DBIFUNCDesc  = packed record
  1693.     szName          : DBINAME;          { Function name }
  1694.     szDesc          : packed array [0..254] of Char; { Short description }
  1695.     uOverload       : Word;             { Number of function overloads }
  1696.     eStdFn          : DBISTDFuncs;      { Corresponds to DBI standard function }
  1697.   end;
  1698.  
  1699.  
  1700.   pDBIFUNCArgDesc = ^DBIFUNCArgDesc;
  1701.   DBIFUNCArgDesc  = packed record
  1702.     uArgNum         : Word;             { Argument position num; 0 for fn return }
  1703.     uFldType        : Word;             { Field type }
  1704.     uSubType        : Word;             { Field subtype (if applicable) }
  1705.     ufuncFlags      : Word;             { Function flags }
  1706.   end;
  1707.  
  1708. {============================================================================}
  1709. {                   Configuration Info Descriptor                            }
  1710. {============================================================================}
  1711.  
  1712.   CFGMode = (
  1713.     cfgPersistent,                      { Persistent only }
  1714.     cfgSession,                         { Session relative only }
  1715.     cfgAll                              { All (system and single session) }
  1716.   );
  1717.  
  1718. type
  1719.   CFGMode2 = type Integer;
  1720. const
  1721.     cfgmNone        = $00;
  1722.     cfgmVirtual     = $01;
  1723.     cfgmPersistent  = $02;
  1724.     cfgmSession     = $04;
  1725.     cfgmAll         = cfgmVirtual or cfgmPersistent or cfgmSession;
  1726.  
  1727. type
  1728.   CFGUpdate = (
  1729.     cfgUpdateOn,                        { Accept updates from other sessions }
  1730.     cfgUpdateOff                        { Do not updates from other sessions }
  1731.   );
  1732.  
  1733. { DbiOpenCfgInfoList }
  1734. type
  1735.   pCFGDesc = ^CFGDesc;
  1736.   CFGDesc = packed record               { Config description }
  1737.     szNodeName      : DBINAME;          { Node name }
  1738.     szDescription   : packed array [0..DBIMAXSCFLDLEN-1] of Char; { Node description }
  1739.     iDataType       : Word;             { Value type }
  1740.     szValue         : packed array [0..DBIMAXSCFLDLEN-1] of Char; { Value }
  1741.     bHasSubnodes    : WordBool;         { True, if not leaf node }
  1742.   end;
  1743.  
  1744.  
  1745. {============================================================================}
  1746. {                    Family descriptor                                       }
  1747. {============================================================================}
  1748.  
  1749.  
  1750. type
  1751.   pFMLType = ^FMLType;
  1752.   FMLType  = (                          { Family member types }
  1753.     fmlUNKNOWN,
  1754.     fmlTABLE,
  1755.     fmlINDEX,
  1756.     fmlFORM,
  1757.     fmlREPORT,
  1758.     fmlVALCHECK,
  1759.     fmlSECINDEX,
  1760.     fmlSECINDEX2,
  1761.     fmlBLOBFILE
  1762.   );
  1763.  
  1764. { DbiOpenFamilyList }
  1765. type
  1766.   pFMLDesc = ^FMLDesc;
  1767.   FMLDesc = packed record               { Family record structure }
  1768.     szName          : DBINAME;          { Member name (documentary) }
  1769.     iId             : Word;             { Id (if applicable) }
  1770.     eType           : FMLType;          { Member type }
  1771.     szFileName      : DBIPATH;          { File name of member }
  1772.   end;
  1773.  
  1774.  
  1775. {============================================================================}
  1776. {                    Language driver descriptor                              }
  1777. {============================================================================}
  1778.  
  1779.  
  1780. const
  1781.   DBIOEM_CP          = 1;               { (dos) }
  1782.   DBIANSI_CP         = 2;               { (win) }
  1783.   DBIOS2_CP          = 3;               { (OS2) }
  1784. (* UNIX etc. *)
  1785.   DBISUNOS_CP        = 4;
  1786.   DBIVMS_CP          = 5;
  1787.   DBIHPUX_CP         = 6;
  1788.   DBIULTRIX_CP       = 7;
  1789.   DBIAIX_CP          = 8;
  1790.   DBIAUX_CP          = 9;
  1791.   DBIXENIX_CP        = 10;
  1792.   DBIMAC_CP          = 11;
  1793.   DBINEXT_CP         = 12;
  1794.   DBIUNICODE_CP      = 13;
  1795.   DBIROMEN8_CP       = 14;
  1796.   DBIISO_CP          = 15;
  1797.  
  1798. { DbiOpenLdList }
  1799. type
  1800.   pLDDesc = ^LDDesc;
  1801.   LDDesc = packed record                { Lang Driver description }
  1802.     szName          : DBINAME;          { Driver symbolic name }
  1803.     szDesc          : DBINAME;          { Description }
  1804.     iCodePage       : Word;
  1805.     PrimaryCpPlatform : Word;
  1806.     AlternateCpPlatform : Word;
  1807.   end;
  1808.  
  1809. {============================================================================}
  1810. {                    Lock descriptor                                         }
  1811. {============================================================================}
  1812.  
  1813. { Lock types in LOCKDesc: }
  1814.  
  1815. const
  1816.   lckRECLOCK         = 0;               { Normal Record lock (Write) }
  1817.   lckRRECLOCK        = 1;               { Special Pdox Record lock (Read) }
  1818.   lckGROUPLOCK       = 2;               { Pdox Group lock }
  1819.   lckIMGAREA         = 3;               { Pdox Image area }
  1820.   lckTABLEREG        = 4;               { Table registration/Open (No lock) }
  1821.   lckTABLEREAD       = 5;               { Table Read lock }
  1822.   lckTABLEWRITE      = 6;               { Table Write lock }
  1823.   lckTABLEEXCL       = 7;               { Table Exclusive lock }
  1824.   lckUNKNOWN         = 9;               { Unknown lock }
  1825.  
  1826. { DbiOpenLockList }
  1827. type
  1828.   pLOCKDesc = ^LOCKDesc;
  1829.   LOCKDesc = packed record              { Lock Description }
  1830.     iType           : Word;             { Lock type (0 for rec lock) }
  1831.     szUserName      : DBIUSERNAME;      { Lock owner }
  1832.     iNetSession     : Word;             { Net level Session number }
  1833.     iSession        : Word;             { Idapi session#, if our lock }
  1834.     iRecNum         : Longint;          { If a record lock }
  1835.     iInfo           : Word;             { Info for table locks }
  1836.   end;
  1837.  
  1838. {============================================================================}
  1839. {                    Filter description                                      }
  1840. {============================================================================}
  1841.  
  1842. type
  1843.   pCANOp = ^CANOp;
  1844.   CANOp  = (
  1845.     canNOTDEFINED,                      {                                  (*) }
  1846.     canISBLANK,                         { CANUnary;  is operand blank.     (*) }
  1847.     canNOTBLANK,                        { CANUnary;  is operand not blank. (*) }
  1848.     canEQ,                              { CANBinary, CANCompare; equal.    (*) }
  1849.     canNE,                              { CANBinary; NOT equal.            (*) }
  1850.     canGT,                              { CANBinary; greater than.         (*) }
  1851.     canLT,                              { CANBinary; less than.            (*) }
  1852.     canGE,                              { CANBinary; greater or equal.     (*) }
  1853.     canLE,                              { CANBinary; less or equal.        (*) }
  1854.     canNOT,                             { CANUnary; NOT                    (*) }
  1855.     canAND,                             { CANBinary; AND                   (*) }
  1856.     canOR,                              { CANBinary; OR                    (*) }
  1857.     canTUPLE2,                          { CANUnary; Entire record is operand. }
  1858.     canFIELD2,                          { CANUnary; operand is field       (*) }
  1859.     canCONST2,                          { CANUnary; operand is constant    (*) }
  1860.     canMINUS,                           { CANUnary;  minus. }
  1861.     canADD,                             { CANBinary; addition. }
  1862.     canSUB,                             { CANBinary; subtraction. }
  1863.     canMUL,                             { CANBinary; multiplication. }
  1864.     canDIV,                             { CANBinary; division. }
  1865.     canMOD,                             { CANBinary; modulo division. }
  1866.     canREM,                             { CANBinary; remainder of division. }
  1867.     canSUM,                             { CANBinary, accumulate sum of. }
  1868.     canCOUNT,                           { CANBinary, accumulate count of. }
  1869.     canMIN,                             { CANBinary, find minimum of. }
  1870.     canMAX,                             { CANBinary, find maximum of. }
  1871.     canAVG,                             { CANBinary, find average of. }
  1872.     canCONT,                            { CANBinary; provides a link between two }
  1873.     canUDF2,                            { CANBinary; invokes a User defined fn }
  1874.     canCONTINUE2,                       { CANUnary; Stops evaluating records }
  1875.     canLIKE,                            { CANCompare, extended binary compare       (*) }
  1876.     canIN,                              { CANBinary field in list of values }
  1877.     canLIST2,                           { List of constant values of same type }
  1878.     canUPPER,                           { CANUnary: upper case }
  1879.     canLOWER,                           { CANUnary: lower case }
  1880.     canFUNC2,                           { CANFunc: Function }
  1881.     canLISTELEM2,                       { CANListElem: List Element }
  1882.     canASSIGN                           { CANBinary: Field assignment }
  1883.   );
  1884.  
  1885.   NODEClass = (                         { Node Class }
  1886.     nodeNULL,                           { Null node                  (*) }
  1887.     nodeUNARY,                          { Node is a unary            (*) }
  1888.     nodeBINARY,                         { Node is a binary           (*) }
  1889.     nodeCOMPARE,                        { Node is a compare          (*) }
  1890.     nodeFIELD,                          { Node is a field            (*) }
  1891.     nodeCONST,                          { Node is a constant         (*) }
  1892.     nodeTUPLE,                          { Node is a record }
  1893.     nodeCONTINUE,                       { Node is a continue node    (*) }
  1894.     nodeUDF,                            { Node is a UDF node }
  1895.     nodeLIST,                           { Node is a LIST node }
  1896.     nodeFUNC,                           { Node is a Function node }
  1897.     nodeLISTELEM                        { Node is a List Element node }
  1898.   );
  1899.  
  1900. { NODE definitions including misc data structures }
  1901. {-------------------------------------------------}
  1902.  
  1903. type
  1904.   pCANHdr = ^CANHdr;
  1905.   CANHdr = packed record                { Header part common to all     (*) }
  1906.     nodeClass       : NODEClass;
  1907.     canOp           : CANOp;
  1908.   end;
  1909.  
  1910.   pCANUnary = ^CANUnary;
  1911.   CANUnary = packed record              { Unary Node                    (*) }
  1912.     nodeClass       : NODEClass;
  1913.     canOp           : CANOp;
  1914.     iOperand1       : Word;             { Byte offset of Operand node }
  1915.   end;
  1916.  
  1917.   pCANBinary = ^CANBinary;
  1918.   CANBinary = packed record             { Binary Node                   (*) }
  1919.     nodeClass       : NODEClass;
  1920.     canOp           : CANOp;
  1921.     iOperand1       : Word;             { Byte offset of Op1 }
  1922.     iOperand2       : Word;             { Byte offset of Op2 }
  1923.   end;
  1924.  
  1925.   pCANField = ^CANField;
  1926.   CANField = packed record              { Field }
  1927.     nodeClass       : NODEClass;
  1928.     canOp           : CANOp;
  1929.     iFieldNum       : Word;
  1930.     iNameOffset     : Word;             { Name offset in Literal pool }
  1931.   end;
  1932.  
  1933.   pCANConst = ^CANConst;
  1934.   CANConst = packed record              { Constant }
  1935.     nodeClass       : NODEClass;
  1936.     canOp           : CANOp;
  1937.     iType           : Word;             { Constant type. }
  1938.     iSize           : Word;             { Constant size. (in bytes) }
  1939.     iOffset         : Word;             { Offset in the literal pool. }
  1940.   end;
  1941.  
  1942.   pCANTuple = ^CANTuple;
  1943.   CANTuple = packed record              { Tuple (record) }
  1944.     nodeClass       : NODEClass;
  1945.     canOp           : CANOp;
  1946.     iSize           : Word;             { Record size. (in bytes) }
  1947.   end;
  1948.  
  1949.   pCANContinue = ^CANContinue;
  1950.   CANContinue = packed record           { Break Node                    (*) }
  1951.     nodeClass       : NODEClass;
  1952.     canOp           : CANOp;
  1953.     iContOperand    : Word;             { Continue if operand is true. }
  1954.   end;
  1955.  
  1956.   pCANCompare = ^CANCompare;
  1957.   CANCompare = packed record            { Extended compare Node (text fields) (*) }
  1958.     nodeClass       : NODEClass;
  1959.     canOp           : CANOp;            { canLIKE, canEQ }
  1960.     bCaseInsensitive : WordBool;        { 3 val: UNKNOWN = "fastest", "native" }
  1961.     iPartialLen     : Word;             { Partial fieldlength (0 is full length) }
  1962.     iOperand1       : Word;             { Byte offset of Op1 }
  1963.     iOperand2       : Word;             { Byte offset of Op2 }
  1964.   end;
  1965.  
  1966.   pCANFunc = ^CANFunc;
  1967.   CANFunc = packed record               { Function }
  1968.     nodeClass       : NODEClass;
  1969.     canOp           : CANOp;
  1970.     iNameOffset     : Word;             { Name offset in Literal pool }
  1971.     iElemOffset     : Word;             { Offset of first List Element in Node pool }
  1972.   end;
  1973.  
  1974.   pCANListElem = ^CANListElem;
  1975.   CANListElem = packed record           { List Element }
  1976.     nodeClass       : NODEClass;
  1977.     canOp           : CANOp;
  1978.     iOffset         : Word;             { Arg offset in Node pool }
  1979.     iNextOffset     : Word;             { Offset in Node pool of next ListElem or 0 if end of list }
  1980.   end;
  1981.  
  1982. {This is the node to be used to pass User defined functions }
  1983. const
  1984.   iLangSQL           = 0;               { Common SQL dialect }
  1985.   iDbaseExpr         = 2;               { This is also the driver ID for dBASE }
  1986.  
  1987. type
  1988.   pCANUdf = ^CANUdf;
  1989.   CANUdf = packed record                { A user defined function }
  1990.     nodeClass       : NODEClass;
  1991.     canOp           : CANOp;
  1992.     iOffSzFuncName  : Word;             { Offset in literal pool to Function Name string(0 terminated) }
  1993.     iOperands       : Word;             { Byte offset of Operands (concatenated using canCONT) }
  1994.     iDrvDialect     : Word;             { Driver Dialect ID for UDF string supplied }
  1995.     iOffSzUDF       : Word;             { Offset in literal pool to UDF string (0 terminated) }
  1996.   end;
  1997.  
  1998.   pCANList = ^CANList;
  1999.   CANList = packed record           { List of Constants }
  2000.     nodeClass       : NODEClass; 
  2001.     canOp           : CANOp;
  2002.     iType           : Word;            { Constant type. }
  2003.     iTotalSize      : Word;            { Total list size; }
  2004.     iElemSize       : Word;            { Size of each elem for fix-width types }
  2005.     iElems          : Word;            { Number of elements in list }
  2006.     iOffset         : Word;            { Offset in the literal pool to first elem. }
  2007.   end;
  2008.  
  2009.   pCANNode = ^CANNode;
  2010.   CANNode = packed record
  2011.     case Integer of
  2012.       0: (canHdr      : CANHdr);
  2013.       1: (canUnary    : CANUnary);
  2014.       2: (canBinary   : CANBinary);
  2015.       3: (canField    : CANField);
  2016.       4: (canConst    : CANConst);
  2017.       5: (canTuple    : CANTuple);
  2018.       6: (canContinue : CANContinue);
  2019.       7: (canCompare  : CANCompare);
  2020.       8: (canList     : CANList);
  2021.       9: (canFunc     : CANFunc);
  2022.      10: (canListElem : CANListElem);
  2023.   end;
  2024.  
  2025. { Linear exression tree}
  2026. {----------------------}
  2027.  
  2028. const
  2029.   CANEXPRVERSION     = 2;
  2030.  
  2031. type
  2032.   ppCANExpr = ^pCANExpr;
  2033.   pCANExpr  = ^CANExpr;
  2034.   CANExpr   = packed record             { Expression Tree }
  2035.     iVer            : Word;             { Version tag of expression. }
  2036.     iTotalSize      : Word;             { Size of this structure }
  2037.     iNodes          : Word;             { Number of nodes }
  2038.     iNodeStart      : Word;             { Starting offet of Nodes in this }
  2039.     iLiteralStart   : Word;             { Starting offset of Literals in this }
  2040.   end;
  2041.  
  2042. {pfGENFilter returns TRUE, FALSE or ABORT }
  2043. const
  2044.   ABORT              = -2;
  2045.  
  2046. type
  2047.   pfGENFilter = function (
  2048.       ulClientData  : Longint;
  2049.       pRecBuf       : Pointer;
  2050.       iPhyRecNum    : Longint
  2051.    ): SmallInt stdcall;
  2052.  
  2053.   pFILTERInfo = ^FILTERInfo;
  2054.   FILTERInfo = packed record
  2055.     iFilterId       : Word;             { Id for filter }
  2056.     hFilter         : hDBIFilter;       { Filter handle }
  2057.     iClientData     : Longint;          { Client supplied data }
  2058.     iPriority       : Word;             { 1..N with 1 being highest }
  2059.     bCanAbort       : WordBool;         { TRUE : pfFilter can return ABORT }
  2060.     pfFilter        : pfGENFilter;      { Client filter function }
  2061.     pCanExpr        : Pointer;          { Supplied expression }
  2062.     bActive         : WordBool;         { TRUE : filter is active }
  2063.   end;
  2064.  
  2065. {----------------------------------------------------------------------------}
  2066. {   DBI Query related types                                                  }
  2067. {----------------------------------------------------------------------------}
  2068.  
  2069. const
  2070.   MAXQBEEXPRSIZE     = 300;             { size of one QBE expr }
  2071.  
  2072. type
  2073.   pDBIQryProp = ^DBIQryProp;
  2074.   DBIQryProp = packed record
  2075.     szQryName       : DBINAME;          { Name of query }
  2076.     eLang           : DBIQryLang;       { Language }
  2077.     iQryPrice       : SmallInt;         { Query price 1..100 (1 = cheap, 100 = expensive) }
  2078.     iNumTables      : SmallInt;         { Number of tables in join.  0 = unknown. }
  2079.     bHasAnswer      : WordBool;
  2080.     bInsert         : WordBool;
  2081.     bDelete         : WordBool;
  2082.     bChange         : WordBool;
  2083.   end;
  2084.  
  2085. const
  2086.   DBIQBE_ANSWERBIT   = ($1);            { Answer table bit flag }
  2087.   DBIQBE_INSERTEDBIT = ($2);            { Inserted table bit flag }
  2088.   DBIQBE_DELETEDBIT  = ($4);            { Deleted table bit flag }
  2089.   DBIQBE_CHANGEDBIT  = ($8);            { Changed table bit flag }
  2090.   DBIQBE_ERRORINSBIT = ($10);           { Error inserted table bit flag }
  2091.   DBIQBE_ERRORDELBIT = ($20);           { Error deleted table bit flag }
  2092.   DBIQBE_ERRORCHGBIT = ($40);           { Error changed table bit flag }
  2093.  
  2094.  
  2095. { answer cursor properties: }
  2096.  
  2097.   bAnsHasLiveFields  = $1;
  2098.   bAnsHasFilter      = $2;
  2099.   bAnsHasFieldMap    = $4;
  2100.   bAnsHasCalcField   = $8;
  2101.   bAnsHasLiveBlob    = $10;
  2102.  
  2103. { answer field properties: }
  2104.  
  2105.   bIsAnsFieldLive    = $1;
  2106.  
  2107. type
  2108.   DBIQryType = (
  2109.     dbiqryDEFAULT,
  2110.     dbiqryDIRTY,
  2111.     dbiqryCLEAN,
  2112.     dbiqryRESTART
  2113.   );
  2114.  
  2115.   pDBIQryProgress = ^DBIQryProgress;
  2116.   DBIQryProgress = packed record
  2117.     stepsInQry      : Word;             { Total steps in query. }
  2118.     stepsCompleted  : Word;             { Steps completed out of total (steps may be skipped). }
  2119.     totElemInStep   : Longint;          { Total elements in current step. }
  2120.     elemCompleted   : Longint;          { Elements completed in current step. }
  2121.   end;
  2122.  
  2123.   QryEvalMode = (
  2124.     qryModeNONE,                        { Reserved }
  2125.     qryModeLOCAL,
  2126.     qryModeSERVER,
  2127.     qryModeEITHER,
  2128.     qryModeNOWLOCAL                     { used only in call back, when failed on server }
  2129.   );
  2130.  
  2131. { values for client indicating live/canned preference about query execution }
  2132.  
  2133.   LIVENESS = (
  2134.     wantDEFAULT,                        { Default , same as wantCANNED }
  2135.     wantLIVE,                           { Want live data even if extra effort (no guarantee) }
  2136.     wantCANNED,                         { Want canned data even if extra effort (guaranteed) }
  2137.     wantSPEED                           { Let query manager decide, find out afterwards }
  2138.   );
  2139.  
  2140.   pQueryLowProps = ^QueryLowProps;
  2141.   QueryLowProps = packed record
  2142.     length          : SmallInt;         { Length in bytes of this structure }
  2143.     blankzeroes     : WordBool;         { TRUE if blanks to be regarded as zeros }
  2144.     dateFormat      : FMTDate;          { Date format }
  2145.     numberFormat    : FMTNumber;        { Number format }
  2146.     bNeedAuxTbls    : WordBool;         { If FALSE, don't bother with DELETED/ERRDEL, etc. }
  2147.     qryMode         : QryEvalMode;      { qryModeSERVER, qryModeLOCAL or qryModeEITHER. }
  2148.     perQrySqlMode   : WordBool;
  2149.     livenessDesired : LIVENESS;
  2150.   end;
  2151.  
  2152. {============================================================================}
  2153. {                      DBI symbols                                           }
  2154. {============================================================================}
  2155.  
  2156. const
  2157.   DBIMOD_BEGIN       = ($3F00);
  2158.  
  2159.   DBIMOD_QBE         = (DBIMOD_BEGIN + 1);
  2160.   DBIMOD_SQLG        = (DBIMOD_BEGIN + 2);
  2161.   DBIMOD_LEGO        = (DBIMOD_BEGIN + 3);
  2162.   DBIMOD_LOCKMNGR    = (DBIMOD_BEGIN + 4);
  2163.   DBIMOD_SQLDRIVER   = (DBIMOD_BEGIN + 5);
  2164.   DBIMOD_OS          = (DBIMOD_BEGIN + 6);
  2165.   DBIMOD_DBASEDRV    = (DBIMOD_BEGIN + 7);
  2166.   DBIMOD_CDR         = (DBIMOD_BEGIN + 8);
  2167.  
  2168.   DBIMOD_END         = (DBIMOD_BEGIN + 9);
  2169.  
  2170. {----------------------------------------------------------------------------}
  2171.  
  2172.   DBISYM_BEGIN       = (DBIMOD_END + 1);
  2173.  
  2174.   DBISYM_TOKEN       = (DBISYM_BEGIN + ecTOKEN);
  2175.   DBISYM_TABLENAME   = (DBISYM_BEGIN + ecTABLENAME);
  2176.   DBISYM_FIELDNAME   = (DBISYM_BEGIN + ecFIELDNAME);
  2177.   DBISYM_IMAGEROW    = (DBISYM_BEGIN + ecIMAGEROW);
  2178.   DBISYM_USERNAME    = (DBISYM_BEGIN + ecUSERNAME);
  2179.   DBISYM_FILENAME    = (DBISYM_BEGIN + ecFILENAME);
  2180.   DBISYM_INDEXNAME   = (DBISYM_BEGIN + ecINDEXNAME);
  2181.   DBISYM_DIRNAME     = (DBISYM_BEGIN + ecDIRNAME);
  2182.   DBISYM_KEYNAME     = (DBISYM_BEGIN + ecKEYNAME);
  2183.   DBISYM_ALIAS       = (DBISYM_BEGIN + ecALIAS);
  2184.   DBISYM_DRIVENAME   = (DBISYM_BEGIN + ecDRIVENAME);
  2185.   DBISYM_NATIVECODE  = (DBISYM_BEGIN + ecNATIVECODE);
  2186.   DBISYM_NATIVEMSG   = (DBISYM_BEGIN + ecNATIVEMSG);
  2187.   DBISYM_LINENUMBER  = (DBISYM_BEGIN + ecLINENUMBER);
  2188.   DBISYM_CAPABILITY  = (DBISYM_BEGIN + ecCAPABILITY);
  2189.   DBISYM_CDRNAME     = (DBISYM_BEGIN + ecCDRNAME);
  2190.   DBISYM_USERERRMSG  = (DBISYM_BEGIN + ecUSERERRMSG);
  2191.   DBISYM_DROBJNAME   = (DBISYM_BEGIN + ecDROBJNAME);
  2192.   DBISYM_INTERNALLIMIT = (DBISYM_BEGIN + ecINTERNALLIMIT);
  2193.   DBISYM_EXPRESSION  = (DBISYM_BEGIN + ecEXPRESSION);
  2194.  
  2195.   DBISYM_BASEEND     = (DBISYM_BEGIN + 100);
  2196.  
  2197. {----------------------------------------------------------------------------}
  2198.  
  2199.   DBISYM_MISC        = (DBISYM_BASEEND + 1);
  2200.  
  2201.   DBISYM_WORK        = (DBISYM_MISC + 1);
  2202.   DBISYM_PRIV        = (DBISYM_MISC + 2);
  2203.   DBISYM_COPY        = (DBISYM_MISC + 3);
  2204.   DBISYM_APPEND      = (DBISYM_MISC + 4);
  2205.   DBISYM_TXTPROBFLD1 = (DBISYM_MISC + 5);
  2206.   DBISYM_TXTPROBFLD2 = (DBISYM_MISC + 6);
  2207.   DBISYM_TXTPROBFLD3 = (DBISYM_MISC + 7);
  2208.  
  2209.  
  2210.   DBISYM_END         = (DBIMOD_BEGIN + $3FFF);
  2211.  
  2212. {============================================================================}
  2213. {                      DBI Config symbols                                    }
  2214. {============================================================================}
  2215.  
  2216. { Categories }
  2217.  
  2218.   szCFGSYSTEM        = 'SYSTEM';
  2219.   szCFGDRIVER        = 'DRIVERS';
  2220.   szCFGDATABASE      = 'DATABASES';
  2221.   szCFGREPOSITORY    = 'REPOSITORIES';
  2222.   szCFGPROVIDERS     = 'PROVIDERS';
  2223.  
  2224. {----------------------------------------------------------------------------}
  2225. { System Fields                                                              }
  2226. {----------------------------------------------------------------------------}
  2227.  
  2228.   szCFGSYSVERSION    = 'VERSION';
  2229.   szCFGSYSNETTYPE    = 'NET TYPE';
  2230.   szCFGSYSNETDIR     = 'NET DIR';
  2231.   szCFGSYSLOCALSHARE = 'LOCAL SHARE';
  2232.   szCFGSYSLANGDRV    = 'LANGDRIVER';
  2233.   szCFGSYSLANGDRVDIR = 'LANGDRVDIR';
  2234.   szCFGSYSMINBUF     = 'MINBUFSIZE';
  2235.   szCFGSYSMAXBUF     = 'MAXBUFSIZE';
  2236.   szCFGSYSLOCKRETRY  = 'LOCKRETRY';
  2237.   szCFGSYSFLAGS      = 'SYSFLAGS';
  2238.   szCFGMAXFILEHANDLES = 'MAXFILEHANDLES';
  2239.   szCFGSQLQRYMODE    = 'SQLQRYMODE';
  2240.   szCFGLOWMEMLIMIT   = 'LOW MEMORY USAGE LIMIT'; { Use this instead of NOLOWMEMBUF }
  2241.   szCFGSYSODBCCFGIMPORT = 'AUTO ODBC';
  2242.   szCFGAUTOODBC      = 'AUTO ODBC';
  2243.   szCFGDEFDRV        = 'DEFAULT DRIVER';
  2244.   szCFGSYSLOCALREPOSITORY = 'DATA REPOSITORY';
  2245. //szCFGSYSCOMMONREPOSITORY = 'COMMON REPOSITORY';
  2246.   szCFGSYSMEMSIZE                = 'MEMSIZE'; 
  2247.   szCFGSYSSHAREDMEMSIZE = 'SHAREDMEMSIZE';
  2248.   szCFGSYSSHAREDMEMLOCATION = 'SHAREDMEMLOCATION';
  2249.  
  2250. {----------------------------------------------------------------------------}
  2251. { Driver Fields                                                              }
  2252. {----------------------------------------------------------------------------}
  2253.  
  2254.   szCFGDRVVERSION    = 'VERSION';
  2255.   szCFGDRVTYPE       = 'TYPE';
  2256.   szCFGDRVDLL        = 'DLL';
  2257.   szCFGDRVDLL32      = 'DLL32';
  2258.   szCFGDRVFLAGS      = 'DRIVER FLAGS';
  2259.   szCFGDRVLANGDRIVER = 'LANGDRIVER';
  2260.   szCFGDRVFILLFACTOR = 'FILL FACTOR';
  2261.   szCFGDRVBLOCKSIZE  = 'BLOCK SIZE';
  2262.   szCFGDRVLOCKPROTOCOL = 'LOCKPROTOCOL';
  2263.   szCFGDRVLEVEL      = 'LEVEL';
  2264.   szCFGDRVVENDINIT   = 'VENDOR INIT';
  2265.   szCFGDRVTRACEMODE  = 'TRACE MODE';
  2266.  
  2267. {----------------------------------------------------------------------------}
  2268. { Dbase Driver fields                                                        }
  2269. {----------------------------------------------------------------------------}
  2270.  
  2271.   szCFGDRVMEMOBLOCKSIZE = 'MEMO FILE BLOCK SIZE';
  2272.   szCFGDRVMDXBLOCKSIZE = 'MDX BLOCK SIZE';
  2273.  
  2274.  
  2275. {----------------------------------------------------------------------------}
  2276. { Driver Nodes                                                               }
  2277. {----------------------------------------------------------------------------}
  2278.  
  2279.   szCFGDRVINIT       = 'INIT';
  2280.   szCFGDBCREATE      = 'DB CREATE';
  2281.   szCFGDBOPEN        = 'DB OPEN';
  2282.   szCFGTBLCREATE     = 'TABLE CREATE';
  2283.   szCFGTBLOPEN       = 'TABLE OPEN';
  2284.  
  2285. {----------------------------------------------------------------------------}
  2286. { Database Nodes                                                             }
  2287. {----------------------------------------------------------------------------}
  2288.  
  2289.   szCFGDBINFO        = 'DB INFO';
  2290.  
  2291. {----------------------------------------------------------------------------}
  2292. { Database fields                                                            }
  2293. {----------------------------------------------------------------------------}
  2294.  
  2295.   szCFGDBTYPE        = 'TYPE';
  2296.   szCFGDBPATH        = 'PATH';
  2297.   szCFGDBDEFAULTDRIVER = 'DEFAULT DRIVER';
  2298.   szCFGDBENABLEBCD   = 'ENABLE BCD';
  2299.  
  2300. {----------------------------------------------------------------------------}
  2301. { Others                                                                     }
  2302. {----------------------------------------------------------------------------}
  2303.  
  2304.   szCFGINIT          = 'INIT';
  2305.   szTYPE             = 'TYPE';
  2306.   szCFGDBSTANDARD    = 'STANDARD';
  2307.   szCFGTRUE          = 'TRUE';
  2308.   szCFGFALSE         = 'FALSE';
  2309.   szOPENMODE         = 'OPEN MODE';
  2310.   szREADWRITE        = 'READ/WRITE';
  2311.   szREADONLY         = 'READ ONLY';
  2312.   szSHAREMODE        = 'SHARE MODE';
  2313.   szEXCLUSIVE        = 'EXCLUSIVE';
  2314.   szSHARED           = 'SHARED';
  2315.   szUSERNAME         = 'USER NAME';
  2316.   szPASSWORD         = 'PASSWORD';
  2317.   szSERVERNAME       = 'SERVER NAME';
  2318.   szDATABASENAME     = 'DATABASE NAME';
  2319.   szSCHEMASIZE       = 'SCHEMA CACHE SIZE';
  2320.   szCFGSTRICTINTEGRITY = 'STRICTINTEGRTY';
  2321.   szSQLPASSMODE      = 'SQLPASSTHRU MODE';
  2322.   szNOTSHARED        = 'NOT SHARED';
  2323.   szSHAREDAUTOCOMMIT = 'SHARED AUTOCOMMIT';
  2324.   szSHAREDNOAUTOCOMMIT = 'SHARED NOAUTOCOMMIT';
  2325.   szSCHEMATIME       = 'SCHEMA CACHE TIME';
  2326.   szMAXQUERYTIME     = 'MAX QUERY TIME';
  2327.   szMAXROWS          = 'MAX ROWS';
  2328.   szLISTSYNONYMS     = 'LIST SYNONYMS';
  2329.   szSYNNONE          = 'NONE';
  2330.   szSYNALL           = 'ALL';
  2331.   szSYNPRIVATE       = 'PRIVATE';
  2332.   szBATCHCOUNT       = 'BATCH COUNT';
  2333.   szBLOBCOUNT        = 'BLOBS TO CACHE'; 
  2334.   szBLOBSIZE         = 'BLOB SIZE';
  2335.   szENABLESCHEMACACHE = 'ENABLE SCHEMA CACHE';
  2336.   szSCHEMACACHEDIR   = 'SCHEMA CACHE DIR';
  2337.   szSYBLHOST         = 'HOST NAME';
  2338.   szSYBLAPP          = 'APPLICATION NAME';
  2339.   szSYBLNATLANG      = 'NATIONAL LANG NAME';
  2340.   szTDSPACKETSIZE    = 'TDS PACKET SIZE';
  2341.   szORAINTEGER       = 'ENABLE INTEGERS';
  2342.   szDBNLS            = 'DBNLS';
  2343.   szCOLLCHAR         = 'COLLCHAR';
  2344.   szROWSETSIZE       = 'ROWSET SIZE';
  2345.   szCFG30            = '3';
  2346.   szCFGSERVER        = 'SERVER';
  2347.   szCFGIDODBC01      = 'IDODBC01.DLL';
  2348.   szCFGIDODBC32      = 'IDODBC32.DLL';
  2349.   szCFGODBCDRIVER    = 'ODBC DRIVER';
  2350.   szCFGNULL          = '';
  2351.   szCFGZERO          = '0';
  2352.   szCFG20            = '20';
  2353.   szCFG64            = '64';
  2354.   szCFG32            = '32';
  2355.   szCFGODBCDSN       = 'ODBC DSN';
  2356.   szCFGTWOHUNDRED    = '200';
  2357.   szCFGNEGONE        = '-1';
  2358.   szCFGEIGHT         = '8';
  2359.   szCLSID            = 'CLSID';
  2360.  
  2361. {----------------------------------------------------------------------------}
  2362. { Repository fields                                                          }
  2363. {----------------------------------------------------------------------------}
  2364.  
  2365.   szCFGDRDBNAME      = 'DATABASE NAME';
  2366.   szCFGDRTBLNAME     = 'TABLE NAME';
  2367.   szCFGDRLANGDRIVER  = 'LANGUAGE DRIVER';
  2368.   szCFGDRDESC        = 'DESCRIPTION';
  2369.  
  2370. {----------------------------------------------------------------------------}
  2371. { SYSTEM DATE/TIME/NUMBER FORMATS                                            }
  2372. { SYSTEM nodes:                                                              }
  2373. {----------------------------------------------------------------------------}
  2374.  
  2375.   szCFGFORMAT        = 'FORMATS';
  2376.  
  2377. {----------------------------------------------------------------------------}
  2378. { Format nodes:                                                              }
  2379. {----------------------------------------------------------------------------}
  2380.  
  2381.   szCFGDATE          = 'DATE';
  2382.   szCFGTIME          = 'TIME';
  2383.   szCFGNUMBER        = 'NUMBER';
  2384.  
  2385. {----------------------------------------------------------------------------}
  2386. { DATE and/or TIME fields:                                                   }
  2387. {----------------------------------------------------------------------------}
  2388.  
  2389.   szCFGSEPARATOR     = 'SEPARATOR';
  2390.   szCFGMODE          = 'MODE';
  2391.   szCFGFOURDIGITYEAR = 'FOURDIGITYEAR';
  2392.   szCFGYEARBIASED    = 'YEARBIASED';
  2393.   szCFGLEADINGZEROM  = 'LEADINGZEROM';
  2394.   szCFGLEADINGZEROD  = 'LEADINGZEROD';
  2395.   szCFGTWELVEHOUR    = 'TWELVEHOUR';
  2396.   szCFGAMSTRING      = 'AMSTRING';
  2397.   szCFGPMSTRING      = 'PMSTRING';
  2398.   szCFGSECONDS       = 'SECONDS';
  2399.   szCFGMILSECONDS    = 'MILSECONDS';
  2400.  
  2401. {----------------------------------------------------------------------------}
  2402. { Number fields:                                                             }
  2403. {----------------------------------------------------------------------------}
  2404.  
  2405.   szCFGDECIMALSEPARATOR = 'DECIMALSEPARATOR';
  2406.   szCFGTHOUSANDSEPARATOR = 'THOUSANDSEPARATOR';
  2407.   szCFGDECIMALDIGITS = 'DECIMALDIGITS';
  2408.   szCFGLEADINGZERON  = 'LEADINGZERON';
  2409.  
  2410. { String resoure id's for each string listed above }
  2411.  
  2412.   DBICFG_BASE        = $3A00;
  2413.  
  2414. {----------------------------------------------------------------------------}
  2415. { Categories                                                                 }
  2416. {----------------------------------------------------------------------------}
  2417.  
  2418.   iCFGSYSTEM         = (DBICFG_BASE + 1);
  2419.   iCFGDRIVER         = (DBICFG_BASE + 2);
  2420.   iCFGDATABASE       = (DBICFG_BASE + 3);
  2421.   iCFGREPOSITORY     = (DBICFG_BASE + 210);
  2422.  
  2423. {----------------------------------------------------------------------------}
  2424. { System Fields                                                              }
  2425. {----------------------------------------------------------------------------}
  2426.  
  2427.   iCFGSYSVERSION     = (DBICFG_BASE + 5);
  2428.   iCFGSYSNETTYPE     = (DBICFG_BASE + 6);
  2429.   iCFGSYSNETDIR      = (DBICFG_BASE + 7);
  2430.   iCFGSYSLOCALSHARE  = (DBICFG_BASE + 8);
  2431.   iCFGSYSLANGDRV     = (DBICFG_BASE + 9);
  2432.   iCFGSYSLANGDRVDIR  = (DBICFG_BASE + 10);
  2433.   iCFGSYSMINBUF      = (DBICFG_BASE + 11);
  2434.   iCFGSYSMAXBUF      = (DBICFG_BASE + 12);
  2435.   iCFGSYSLOCKRETRY   = (DBICFG_BASE + 13);
  2436.   iCFGSYSFLAGS       = (DBICFG_BASE + 14);
  2437.   iCFGMAXFILEHANDLES = (DBICFG_BASE + 15);
  2438.   iCFGSQLQRYMODE     = (DBICFG_BASE + 16);
  2439.   iCFGLOWMEMLIMIT    = (DBICFG_BASE + 17);
  2440.   iCFGSYSODBCCFGIMPORT = (DBICFG_BASE + 18);
  2441.   iCFGSYSLOCALREPOSITORY = (DBICFG_BASE + 211);
  2442. //iCFGSYSCOMMONREPOSITORY = (DBICFG_BASE + 212);
  2443.   iCFGSYSSHAREDMEMSIZE = (DBICFG_BASE + 250);
  2444.   iCFGSYSSHAREDMEMLOCATION = (DBICFG_BASE + 251);
  2445.   iCFGSYSMEMSIZE     = DBICFG_BASE + 125;
  2446.  
  2447.  
  2448. {----------------------------------------------------------------------------}
  2449. { Driver Fields                                                              }
  2450. {----------------------------------------------------------------------------}
  2451.  
  2452.   iCFGDRVVERSION     = (DBICFG_BASE + 20);
  2453.   iCFGDRVTYPE        = (DBICFG_BASE + 21);
  2454.   iCFGDRVLANGDRIVER  = (DBICFG_BASE + 22);
  2455.   iCFGDRVFILLFACTOR  = (DBICFG_BASE + 23);
  2456.   iCFGDRVBLOCKSIZE   = (DBICFG_BASE + 24);
  2457.   iCFGDRVLOCKPROTOCOL = (DBICFG_BASE + 25);
  2458.   iCFGDRVLEVEL       = (DBICFG_BASE + 26);
  2459.   iCFGDRVFLAGS       = (DBICFG_BASE + 27);
  2460.   iCFGDRVTRACEMODE   = (DBICFG_BASE + 28);
  2461.   iCFGDRVDLL32       = (DBICFG_BASE + 29);
  2462.  
  2463. {----------------------------------------------------------------------------}
  2464. { Dbase Driver fields                                                        }
  2465. {----------------------------------------------------------------------------}
  2466.  
  2467.   iCFGDRVMEMOBLOCKSIZE = (DBICFG_BASE + 30 );
  2468.   iCFGDRVMDXBLOCKSIZE = (DBICFG_BASE + 31 );
  2469.  
  2470. {----------------------------------------------------------------------------}
  2471. { Driver Nodes                                                               }
  2472. {----------------------------------------------------------------------------}
  2473.  
  2474.   iCFGDRVINIT        = (DBICFG_BASE + 40 );
  2475.   iCFGDBCREATE       = (DBICFG_BASE + 41 );
  2476.   iCFGDBOPEN         = (DBICFG_BASE + 42 );
  2477.   iCFGTBLCREATE      = (DBICFG_BASE + 43 );
  2478.   iCFGTBLOPEN        = (DBICFG_BASE + 44 );
  2479.  
  2480. {----------------------------------------------------------------------------}
  2481. { Database Nodes                                                             }
  2482. {----------------------------------------------------------------------------}
  2483.  
  2484.   iCFGDBINFO         = (DBICFG_BASE + 50 );
  2485.  
  2486. {----------------------------------------------------------------------------}
  2487. { Database fields                                                            }
  2488. {----------------------------------------------------------------------------}
  2489.  
  2490.   iCFGDBTYPE         = (DBICFG_BASE + 60);
  2491.   iCFGDBPATH         = (DBICFG_BASE + 61);
  2492.   iCFGDBDEFAULTDRIVER = (DBICFG_BASE + 62);
  2493.   iCFGDBENABLEBCD    = (DBICFG_BASE + 63);
  2494.  
  2495. {----------------------------------------------------------------------------}
  2496. { Others                                                                     }
  2497. {----------------------------------------------------------------------------}
  2498.  
  2499.   iCFGINIT           = (DBICFG_BASE + 70);
  2500.   iTYPE              = (DBICFG_BASE + 71);
  2501.   iCFGDBSTANDARD     = (DBICFG_BASE + 72);
  2502.   iCFGTRUE           = (DBICFG_BASE + 73);
  2503.   iCFGFALSE          = (DBICFG_BASE + 74);
  2504.   iOPENMODE          = (DBICFG_BASE + 75);
  2505.   iREADWRITE         = (DBICFG_BASE + 76);
  2506.   iREADONLY          = (DBICFG_BASE + 77);
  2507.   iSHAREMODE         = (DBICFG_BASE + 78);
  2508.   iEXCLUSIVE         = (DBICFG_BASE + 79);
  2509.   iSHARED            = (DBICFG_BASE + 80);
  2510.   iUSERNAME          = (DBICFG_BASE + 81);
  2511.   iSERVERNAME        = (DBICFG_BASE + 82);
  2512.   iDATABASENAME      = (DBICFG_BASE + 83);
  2513.   iSCHEMASIZE        = (DBICFG_BASE + 84);
  2514.   iCFGSTRICTINTEGRITY = (DBICFG_BASE + 85);
  2515.   iTDSPACKETSIZE     = (DBICFG_BASE + 86);
  2516.   iORAINTEGER        = (DBICFG_BASE + 87);
  2517.   iDBNLS             = (DBICFG_BASE + 88);
  2518.   iCOLLCHAR          = (DBICFG_BASE + 89);
  2519.   { numbers 90-122 used in dbiext.h }
  2520.   iROWSETSIZE        = (DBICFG_BASE + 134);
  2521.  
  2522. {----------------------------------------------------------------------------}
  2523. { Repository Nodes                                                           }
  2524. {----------------------------------------------------------------------------}
  2525.  
  2526.   iCFGDRDBNAME       = (DBICFG_BASE + 213);
  2527.   iCFGDRTBLNAME      = (DBICFG_BASE + 214);
  2528.   iCFGDRDESC         = (DBICFG_BASE + 215);
  2529.   iCFGDRLANGDRIVER   = (DBICFG_BASE + 212);
  2530.  
  2531. {----------------------------------------------------------------------------}
  2532. { System node:                                                               }
  2533. {----------------------------------------------------------------------------}
  2534.  
  2535.   iCFGFORMAT         = (DBICFG_BASE + 130);
  2536.  
  2537. {----------------------------------------------------------------------------}
  2538. { Format nodes:                                                              }
  2539. {----------------------------------------------------------------------------}
  2540.  
  2541.   iCFGDATE           = (DBICFG_BASE + 131);
  2542.   iCFGTIME           = (DBICFG_BASE + 132);
  2543.   iCFGNUMBER         = (DBICFG_BASE + 133);
  2544.  
  2545. {----------------------------------------------------------------------------}
  2546. { DATE and/or TIME fields:                                                   }
  2547. {----------------------------------------------------------------------------}
  2548.  
  2549.   iCFGSEPARATOR      = (DBICFG_BASE + 140);
  2550.   iCFGMODE           = (DBICFG_BASE + 141);
  2551.   iCFGFOURDIGITYEAR  = (DBICFG_BASE + 142);
  2552.   iCFGYEARBIASED     = (DBICFG_BASE + 143);
  2553.   iCFGLEADINGZEROM   = (DBICFG_BASE + 144);
  2554.   iCFGLEADINGZEROD   = (DBICFG_BASE + 145);
  2555.   iCFGTWELVEHOUR     = (DBICFG_BASE + 146);
  2556.   iCFGAMSTRING       = (DBICFG_BASE + 147);
  2557.   iCFGPMSTRING       = (DBICFG_BASE + 148);
  2558.   iCFGSECONDS        = (DBICFG_BASE + 149);
  2559.   iCFGMILSECONDS     = (DBICFG_BASE + 150);
  2560.  
  2561. {----------------------------------------------------------------------------}
  2562. { Number fields:                                                             }
  2563. {----------------------------------------------------------------------------}
  2564.  
  2565.   iCFGDECIMALSEPARATOR  = (DBICFG_BASE + 160);
  2566.   iCFGTHOUSANDSEPARATOR = (DBICFG_BASE + 161);
  2567.   iCFGDECIMALDIGITS     = (DBICFG_BASE + 162);
  2568.   iCFGLEADINGZERON      = (DBICFG_BASE + 163);
  2569.  
  2570.   iCFGDEFLANGDRV        = (DBICFG_BASE + 165);
  2571.   iCFGDBASEDEFLANGDRV   = (DBICFG_BASE + 166);
  2572.  
  2573. {----------------------------------------------------------------------------}
  2574. { Formats                                                                    }
  2575. {----------------------------------------------------------------------------}
  2576.  
  2577.   iCFGDEFSEPARATOR          = (DBICFG_BASE + 170);
  2578.   iCFGDEFMODE               = (DBICFG_BASE + 171);
  2579.   iCFGDEFFOURDIGITYEAR      = (DBICFG_BASE + 172);
  2580.   iCFGDEFYEARBIASED         = (DBICFG_BASE + 173);
  2581.   iCFGDEFLEADINGZEROM       = (DBICFG_BASE + 174);
  2582.   iCFGDEFLEADINGZEROD       = (DBICFG_BASE + 175);
  2583.   iCFGDEFTWELVEHOUR         = (DBICFG_BASE + 176);
  2584.   iCFGDEFAMSTRING           = (DBICFG_BASE + 177);
  2585.   iCFGDEFPMSTRING           = (DBICFG_BASE + 178);
  2586.   iCFGDEFSECONDS            = (DBICFG_BASE + 179);
  2587.   iCFGDEFMILSECONDS         = (DBICFG_BASE + 180);
  2588.   iCFGDEFDECIMALSEPARATOR   = (DBICFG_BASE + 181);
  2589.   iCFGDEFTHOUSANDSEPARATOR  = (DBICFG_BASE + 182);
  2590.   iCFGDEFLEADINGZERO        = (DBICFG_BASE + 183);
  2591.  
  2592.   iCFGDEFVERSION            = (DBICFG_BASE + 184);
  2593.   iCFGDEFLOCALSHARE         = (DBICFG_BASE + 185);
  2594.   iCFGDEFMINBUFSIZE         = (DBICFG_BASE + 186);
  2595.   iCFGDEFMAXBUFSIZE         = (DBICFG_BASE + 187);
  2596.   iCFGDEFMAXFILEHANDLES     = (DBICFG_BASE + 188);
  2597.   iCFGDEFSYSFLAGS           = (DBICFG_BASE + 189);
  2598.   iCFGDEFLOWMEM             = (DBICFG_BASE + 190);
  2599.   iCFGDEFAUTOODBC           = (DBICFG_BASE + 191);
  2600.   iCFGDEFDEFDRV             = (DBICFG_BASE + 192);
  2601.  
  2602.   iCFGDEFDECIMALDIGITS      = (DBICFG_BASE + 193);
  2603.   iCFGDEFLEADINGZERON       = (DBICFG_BASE + 194);
  2604.  
  2605.   iCFGDEFPDXTYPE            = (DBICFG_BASE + 195);
  2606.   iCFGDEFPDXNETDIR          = (DBICFG_BASE + 196);
  2607.   iCFGDEFPDXLANGDRV         = (DBICFG_BASE + 197);
  2608.   iCFGDEFPDXLEVEL           = (DBICFG_BASE + 198);
  2609.   iCFGDEFPDXBLOCKSIZE       = (DBICFG_BASE + 199);
  2610.   iCFGDEFPDXFILLFACTOR      = (DBICFG_BASE + 200);
  2611.   iCFGDEFPDXSTRICTINTEGRTY  = (DBICFG_BASE + 201);
  2612.  
  2613.   iCFGDEFDBASETYPE          = (DBICFG_BASE + 202);
  2614.   iCFGDEFDBASELANGDRV       = (DBICFG_BASE + 203);
  2615.   iCFGDEFDBASELEVEL         = (DBICFG_BASE + 204);
  2616.   iCFGDEFDBASEMDXBLOCKSIZE  = (DBICFG_BASE + 205);
  2617.   iCFGDEFDBASEMEMOBLOCKSIZE = (DBICFG_BASE + 206);
  2618.  
  2619.   iCFGAUTOODBC              = (DBICFG_BASE + 207);
  2620.   iCFGDEFDRV                = (DBICFG_BASE + 208);
  2621.   iCFGENABLEBCD             = (DBICFG_BASE + 209);
  2622.   iCFGDEFSHAREDMEMSIZE      = (DBICFG_BASE + 252);
  2623.   iCFGDEFSHAREDMEMLOCATION  = (DBICFG_BASE + 253);
  2624.   iCFGDEFREPOSITORY         = (DBICFG_BASE + 254);
  2625.   iCFGDEFSQLQRYMODE         = (DBICFG_BASE + 255);
  2626.   iCFGDEFMEMSIZE            = (DBICFG_BASE + 126); 
  2627.  
  2628. { MSACCESS default driver field values }
  2629.   iCFGDEFMSACCESSVER        = (DBICFG_BASE + 220);
  2630.   iCFGDEFMSACCESSTYPE       = (DBICFG_BASE + 221);
  2631.   iCFGDEFMSACCESSDLL32      = (DBICFG_BASE + 222);
  2632.   iCFGDEFMSACCESSLANGDRV    = (DBICFG_BASE + 223);
  2633.   iCFGDEFDATABASENAME       = (DBICFG_BASE + 224);
  2634.   iCFGDEFUSERNAME           = (DBICFG_BASE + 225);
  2635.   iCFGDEFTRACEMODE          = (DBICFG_BASE + 226);
  2636.   iCFGDEFDRVFLAGS           = (DBICFG_BASE + 227);
  2637.  
  2638.  
  2639.   CFGHLP_BASE               = $3B00;
  2640.  
  2641.   iCFGHLP_SYSNODE           = (CFGHLP_BASE +1);
  2642.   iCFGHLP_SYSINITNODE       = (CFGHLP_BASE +2);
  2643.   iCFGHLP_SYSVERSION        = (CFGHLP_BASE +3);
  2644.   iCFGHLP_SYSLOCALSHARE     = (CFGHLP_BASE +4);
  2645.   iCFGHLP_SYSMINBUFSIZE     = (CFGHLP_BASE +5);
  2646.   iCFGHLP_SYSMAXBUFSIZE     = (CFGHLP_BASE +6);
  2647.   iCFGHLP_SYSLANGDRIVER     = (CFGHLP_BASE +7);
  2648.   iCFGHLP_SYSNETTYPE        = (CFGHLP_BASE +8);
  2649.   iCFGHLP_SYSFLAGS          = (CFGHLP_BASE +9);
  2650.   iCFGHLP_SYSMAXFILE        = (CFGHLP_BASE +10);
  2651.   iCFGHLP_SYSLOWMEM         = (CFGHLP_BASE +11);
  2652.   iCFGHLP_SYSAUTOODBC       = (CFGHLP_BASE +12);
  2653.   iCFGHLP_SYSDEFDRV         = (CFGHLP_BASE +13);
  2654.   iCFGHLP_SYSSQLQRYMODE     = (CFGHLP_BASE +14);
  2655.   iCFGHLP_SYSSQLPASSTHRU    = (CFGHLP_BASE +15);
  2656.   iCFGHLP_SYSFORMATNODE     = (CFGHLP_BASE +16);
  2657.   iCFGHLP_DATENODE          = (CFGHLP_BASE +17);
  2658.   iCFGHLP_DATESEPARATOR     = (CFGHLP_BASE +18);
  2659.   iCFGHLP_DATEMODE          = (CFGHLP_BASE +19);
  2660.   iCFGHLP_DATEFOURDIGIT     = (CFGHLP_BASE +20);
  2661.   iCFGHLP_DATEYEARBIASED    = (CFGHLP_BASE +21);
  2662.   iCFGHLP_DATEZEROM         = (CFGHLP_BASE +22);
  2663.   iCFGHLP_DATEZEROD         = (CFGHLP_BASE +23);
  2664.   iCFGHLP_TIMENODE          = (CFGHLP_BASE +24);
  2665.   iCFGHLP_TIMETWELVEHOUR    = (CFGHLP_BASE +25);
  2666.   iCFGHLP_TIMEAMSTRING      = (CFGHLP_BASE +26);
  2667.   iCFGHLP_TIMEPMSTRING      = (CFGHLP_BASE +27);
  2668.   iCFGHLP_TIMESECONDS       = (CFGHLP_BASE +28);
  2669.   iCFGHLP_TIMEMILSEC        = (CFGHLP_BASE +29);
  2670.   iCFGHLP_NUMNODE           = (CFGHLP_BASE +30);
  2671.   iCFGHLP_NUMDECIMALSEPARATOR = (CFGHLP_BASE +31);
  2672.   iCFGHLP_NUMTHOUSANDSEPARATOR = (CFGHLP_BASE +32);
  2673.   iCFGHLP_NUMDECIMALDIGITS  = (CFGHLP_BASE +33);
  2674.   iCFGHLP_NUMZERON          = (CFGHLP_BASE +34);
  2675.   iCFGHLP_DRVNODE           = (CFGHLP_BASE +35);
  2676.   iCFGHLP_PDXNODE           = (CFGHLP_BASE +36);
  2677.   iCFGHLP_PDXINITNODE       = (CFGHLP_BASE +37);
  2678.   iCFGHLP_DRVTYPE           = (CFGHLP_BASE +38);
  2679.   iCFGHLP_PDXNETDIR         = (CFGHLP_BASE +39);
  2680.   iCFGHLP_PDXTBLNODE        = (CFGHLP_BASE +40);
  2681.   iCFGHLP_PDXLEVEL          = (CFGHLP_BASE +41);
  2682.   iCFGHLP_PDXBLOCKSIZE      = (CFGHLP_BASE +42);
  2683.   iCFGHLP_PDXFILLFACTOR     = (CFGHLP_BASE +43);
  2684.   iCFGHLP_PDXSTRICT         = (CFGHLP_BASE +44);
  2685.   iCFGHLP_DBNODE            = (CFGHLP_BASE +45);
  2686.   iCFGHLP_DBINITNODE        = (CFGHLP_BASE +46);
  2687.   iCFGHLP_DBVERSION         = (CFGHLP_BASE +47);
  2688.   iCFGHLP_DBTBLNODE         = (CFGHLP_BASE +48);
  2689.   iCFGHLP_DBLEVEL           = (CFGHLP_BASE +49);
  2690.   iCFGHLP_DBMDXBLOCKSIZE    = (CFGHLP_BASE +50);
  2691.   iCFGHLP_DBMEMOFILEBLOCKSIZE = (CFGHLP_BASE +51);
  2692.   iCFGHLP_INTNODE           = (CFGHLP_BASE +52);
  2693.   iCFGHLP_INTINITNODE       = (CFGHLP_BASE +53);
  2694.   iCFGHLP_INTVERSION        = (CFGHLP_BASE +54);
  2695.   iCFGHLP_SQLDLL            = (CFGHLP_BASE +55);
  2696.   iCFGHLP_SQLDLL32          = (CFGHLP_BASE +56);
  2697.   iCFGHLP_SQLDRIVERFLAGS    = (CFGHLP_BASE +57);
  2698.   iCFGHLP_INTDBNODE         = (CFGHLP_BASE +58);
  2699.   iCFGHLP_SQLSERVER         = (CFGHLP_BASE +59);
  2700.   iCFGHLP_SQLUSER           = (CFGHLP_BASE +60);
  2701.   iCFGHLP_SQLOPENMODE       = (CFGHLP_BASE +61);
  2702.   iCFGHLP_SQLSCHEMASIZE     = (CFGHLP_BASE +62);
  2703.   iCFGHLP_SQLSCHEMATIME     = (CFGHLP_BASE +63);
  2704.   iCFGHLP_SYBNODE           = (CFGHLP_BASE +64);
  2705.   iCFGHLP_SYBINITNODE       = (CFGHLP_BASE +65);
  2706.   iCFGHLP_SYBVERSION        = (CFGHLP_BASE +66);
  2707.   iCFGHLP_SQLCONNECT        = (CFGHLP_BASE +67);
  2708.   iCFGHLP_SQLTIMEOUT        = (CFGHLP_BASE +68);
  2709.   iCFGHLP_SYBDBNODE         = (CFGHLP_BASE +69);
  2710.   iCFGHLP_SQLDATABASE       = (CFGHLP_BASE +70);
  2711.   iCFGHLP_SQLBLOBEDIT       = (CFGHLP_BASE +71);
  2712.   iCFGHLP_SQLMAXQUERY       = (CFGHLP_BASE +72);
  2713.   iCFGHLP_ORANODE           = (CFGHLP_BASE +73);
  2714.   iCFGHLP_ORAINITNODE       = (CFGHLP_BASE +74);
  2715.   iCFGHLP_ORAVERSION        = (CFGHLP_BASE +75);
  2716.   iCFGHLP_SQLVENDOR         = (CFGHLP_BASE +76);
  2717.   iCFGHLP_ORADBNODE         = (CFGHLP_BASE +77);
  2718.   iCFGHLP_SQLNETPROTOCOL    = (CFGHLP_BASE +78);
  2719.   iCFGHLP_MSSNODE           = (CFGHLP_BASE +79);
  2720.   iCFGHLP_MSSINITNODE       = (CFGHLP_BASE +80);
  2721.   iCFGHLP_MSSVERSION        = (CFGHLP_BASE +81);
  2722.   iCFGHLP_MSSDBNODE         = (CFGHLP_BASE +82);
  2723.   iCFGHLP_INFNODE           = (CFGHLP_BASE +83);
  2724.   iCFGHLP_INFINITNODE       = (CFGHLP_BASE +84);
  2725.   iCFGHLP_INFVERSION        = (CFGHLP_BASE +85);
  2726.   iCFGHLP_INFDBNODE         = (CFGHLP_BASE +86);
  2727.   iCFGHLP_SQLLOCKMODE       = (CFGHLP_BASE +87);
  2728.   iCFGHLP_SQLTRACEMODE      = (CFGHLP_BASE +88);
  2729.   iCFGHLP_SQLMAXROWS        = (CFGHLP_BASE +89);
  2730.   iCFGHLP_SQLBATCHCOUNT     = (CFGHLP_BASE +90);
  2731.   iCFGHLP_SYSSHAREDMEMSIZ   = (CFGHLP_BASE +91);
  2732.   iCFGHLP_SYSSHAREDMEMLOC   = (CFGHLP_BASE +92);
  2733.   iCFGHLP_SYSDATAREP        = (CFGHLP_BASE +93);
  2734.   iCFGHLP_ALIASTYPE         = (CFGHLP_BASE +94);
  2735.   iCFGHLP_ALIASPATH         = (CFGHLP_BASE +95);
  2736.   iCFGHLP_ALIASDEFDRV       = (CFGHLP_BASE +96);
  2737.   iCFGHLP_ENABLESCHEMACACHE = (CFGHLP_BASE +97);
  2738.   iCFGHLP_SCHEMACACHEDIR    = (CFGHLP_BASE +98);
  2739.   iCFGHLP_HOSTNAME          = (CFGHLP_BASE +99);
  2740.   iCFGHLP_APPLICATIONNAME   = (CFGHLP_BASE +100);
  2741.   iCFGHLP_NATIONALLANGNAME  = (CFGHLP_BASE +101);
  2742.   iCFGHLP_ALIASENABLEBCD    = (CFGHLP_BASE +102);
  2743.   iCFGHLP_TDSPACKETSIZE     = (CFGHLP_BASE +103);
  2744.   iCFGHLP_ORAINTEGER        = (CFGHLP_BASE +104);
  2745.   iCFGHLP_ORALISTSYNONYMS   = (CFGHLP_BASE +105);
  2746.   iCFGHLP_ROWSETSIZE        = (CFGHLP_BASE +106);
  2747.   iCFGHLP_DB2DRIVER         = (CFGHLP_BASE +107);
  2748.   iCFGHLP_DB2DSN            = (CFGHLP_BASE +108);
  2749.   iCFGHLP_DB2NODE           = (CFGHLP_BASE +109);
  2750.   iCFGHLP_DB2INITNODE       = (CFGHLP_BASE +110);
  2751.   iCFGHLP_DB2VERSION        = (CFGHLP_BASE +111);
  2752.   iCFGHLP_DB2DBNODE         = (CFGHLP_BASE +112);
  2753.   iCFGHLP_COLLCHAR          = (CFGHLP_BASE +113);
  2754.   iCFGHLP_DBNLS             = (CFGHLP_BASE +114);
  2755.   iCFGHLP_MSACCNODE         = (CFGHLP_BASE +115);
  2756.   iCFGHLP_MSACCINITNODE     = (CFGHLP_BASE +116);
  2757.   iCFGHLP_MSACCVERSION      = (CFGHLP_BASE +117);
  2758.   iCFGHLP_MSACCDBNODE       = (CFGHLP_BASE +118);
  2759.   iCFGHLP_ODBCDRIVER        = (CFGHLP_BASE +119);
  2760.   iCFGHLP_ODBCVERSION       = (CFGHLP_BASE +120);
  2761.   iCFGHLP_ODBCDSN           = (CFGHLP_BASE +121);
  2762.   iCFGHLP_OLEVERSION        = (CFGHLP_BASE +122);
  2763.   iCFGHLP_OLECLSID          = (CFGHLP_BASE +123);
  2764.   iCFGHLP_BLOBSTOCACHE      = (CFGHLP_BASE +124);
  2765.   iCFGHLP_BLOBSIZE          = (CFGHLP_BASE +125);
  2766.   iCFGHLP_SYSMEMSIZE        = (CFGHLP_BASE +126);
  2767.  
  2768. {============================================================================}
  2769. {                            Error Categories                                }
  2770. {============================================================================}
  2771.  
  2772. function ErrCat(rslt: Word): Word;
  2773. function ErrCode(rslt: Word): Word;
  2774.  
  2775. const
  2776.   ERRCAT_NONE                   = 0;      {  0   No error }
  2777.   ERRCAT_SYSTEM                 = $21;    {  33  System related (Fatal Error) }
  2778.   ERRCAT_NOTFOUND               = $22;    {  34  Object of interest Not Found }
  2779.   ERRCAT_DATACORRUPT            = $23;    {  35  Physical Data Corruption }
  2780.   ERRCAT_IO                     = $24;    {  36  I/O related error }
  2781.   ERRCAT_LIMIT                  = $25;    {  37  Resource or Limit error }
  2782.   ERRCAT_INTEGRITY              = $26;    {  38  Integrity Violation }
  2783.   ERRCAT_INVALIDREQ             = $27;    {  39  Invalid Request }
  2784.   ERRCAT_LOCKCONFLICT           = $28;    {  40  Locking/Contention related }
  2785.   ERRCAT_SECURITY               = $29;    {  41  Access Violation - Security related }
  2786.   ERRCAT_INVALIDCONTEXT         = $2A;    {  42  Invalid context }
  2787.   ERRCAT_OS                     = $2B;    {  43  Os Error not handled by Idapi }
  2788.   ERRCAT_NETWORK                = $2C;    {  44  Network related }
  2789.   ERRCAT_OPTPARAM               = $2D;    {  45  Optional parameter related }
  2790.   ERRCAT_QUERY                  = $2E;    {  46  Query related }
  2791.   ERRCAT_VERSION                = $2F;    {  47  Version Mismatch Category }
  2792.   ERRCAT_CAPABILITY             = $30;    {  48  Capability not supported }
  2793.   ERRCAT_CONFIG                 = $31;    {  49  System configuration error }
  2794.   ERRCAT_WARNING                = $32;    {  50 }
  2795.   ERRCAT_OTHER                  = $33;    {  51  Miscellaneous }
  2796.   ERRCAT_COMPATIBILITY          = $34;    {  52  Compatibility related }
  2797.   ERRCAT_REPOSITORY             = $35;    {  53  Data Repository related }
  2798.  
  2799.   ERRCAT_DRIVER                 = $3E;    {  62  Driver related }
  2800.   ERRCAT_RC                     = $3F;    {  63  Internal }
  2801.  
  2802.  
  2803.   ERRBASE_NONE                  = 0;      { No error }
  2804.   ERRBASE_SYSTEM                = $2100;  { System related (Fatal Error) }
  2805.   ERRBASE_NOTFOUND              = $2200;  { Object of interest Not Found }
  2806.   ERRBASE_DATACORRUPT           = $2300;  { Physical Data Corruption }
  2807.   ERRBASE_IO                    = $2400;  { I/O related error }
  2808.   ERRBASE_LIMIT                 = $2500;  { Resource or Limit error }
  2809.   ERRBASE_INTEGRITY             = $2600;  { Integrity Violation }
  2810.   ERRBASE_INVALIDREQ            = $2700;  { Invalid Request }
  2811.   ERRBASE_LOCKCONFLICT          = $2800;  { Locking/Contention related }
  2812.   ERRBASE_SEC                   = $2900;  { Access Violation - Security related }
  2813.   ERRBASE_IC                    = $2A00;  { Invalid context }
  2814.   ERRBASE_OS                    = $2B00;  { Os Error not handled by Idapi }
  2815.   ERRBASE_NETWORK               = $2C00;  { Network related }
  2816.   ERRBASE_OPTPARAM              = $2D00;  { Optional Parameter related }
  2817.   ERRBASE_QUERY                 = $2E00;  { Query related }
  2818.   ERRBASE_VERSION               = $2F00;  { Version Mismatch Category }
  2819.   ERRBASE_CAPABILITY            = $3000;  { Capability not supported }
  2820.   ERRBASE_CONFIG                = $3100;  { System configuration error }
  2821.   ERRBASE_WARNING               = $3200;
  2822.   ERRBASE_OTHER                 = $3300;  { Miscellaneous }
  2823.   ERRBASE_COMPATIBILITY         = $3400;  { Compatibility related }
  2824.   ERRBASE_REPOSITORY            = $3500;  { Data Repository related }
  2825.  
  2826.   ERRBASE_DRIVER                = $3E00;  { Driver related }
  2827.   ERRBASE_RC                    = $3F00;  { Internal }
  2828.  
  2829.  
  2830. {=============================================================================}
  2831. {                           Error Codes By Category                           }
  2832. {=============================================================================}
  2833.  
  2834. { ERRCAT_NONE                  (0) }
  2835. { ===========                      }
  2836.  
  2837.   ERRCODE_NONE                  = 0;
  2838.  
  2839.   DBIERR_NONE                   = (ERRBASE_NONE + ERRCODE_NONE);
  2840.  
  2841. {  ERRCAT_SYSTEM }
  2842. {  ============= }
  2843.  
  2844.   ERRCODE_SYSFILEOPEN           = 1;      { Cannot open a system file }
  2845.   ERRCODE_SYSFILEIO             = 2;      { I/O error on a system file }
  2846.   ERRCODE_SYSCORRUPT            = 3;      { Data structure corruption }
  2847.   ERRCODE_NOCONFIGFILE          = 4;      { Cannot find config file }
  2848.   ERRCODE_CFGCANNOTWRITE        = 5;      { Cannot write config file (READONLY) }
  2849.   ERRCODE_CFGMULTIFILE          = 6;      { Initializing with different ini file }
  2850.   ERRCODE_REENTERED             = 7;      { System has been illegally re-entered }
  2851.   ERRCODE_CANTFINDIDAPI         = 8;      { Cannot locate IDAPIxx.DLL }
  2852.   ERRCODE_CANTLOADIDAPI         = 9;      { Cannot load IDAPIxx.DLL }
  2853.   ERRCODE_CANTLOADLIBRARY       = 10;     { Cannot load a service DLL }
  2854.   ERRCODE_TEMPFILEERR           = 11;     { Cannot create or open temporary file }
  2855.   ERRCODE_MULTIPLEIDAPI         = 12;     { Trying to load multiple IDAPIxx.DLL }
  2856.  
  2857.   DBIERR_SYSFILEOPEN            = (ERRBASE_SYSTEM + ERRCODE_SYSFILEOPEN);
  2858.   DBIERR_SYSFILEIO              = (ERRBASE_SYSTEM + ERRCODE_SYSFILEIO);
  2859.   DBIERR_SYSCORRUPT             = (ERRBASE_SYSTEM + ERRCODE_SYSCORRUPT);
  2860.   DBIERR_NOCONFIGFILE           = (ERRBASE_SYSTEM + ERRCODE_NOCONFIGFILE);
  2861.   DBIERR_CFGCANNOTWRITE         = (ERRBASE_SYSTEM + ERRCODE_CFGCANNOTWRITE);
  2862.   DBIERR_CFGMULTIFILE           = (ERRBASE_SYSTEM + ERRCODE_CFGMULTIFILE);
  2863.   DBIERR_REENTERED              = (ERRBASE_SYSTEM + ERRCODE_REENTERED);
  2864.   DBIERR_CANTFINDIDAPI          = (ERRBASE_SYSTEM + ERRCODE_CANTFINDIDAPI);
  2865.   DBIERR_CANTLOADIDAPI          = (ERRBASE_SYSTEM + ERRCODE_CANTLOADIDAPI);
  2866.   DBIERR_CANTLOADLIBRARY        = (ERRBASE_SYSTEM + ERRCODE_CANTLOADLIBRARY);
  2867.   DBIERR_TEMPFILEERR            = (ERRBASE_SYSTEM + ERRCODE_TEMPFILEERR);
  2868.   DBIERR_MULTIPLEIDAPI          = (ERRBASE_SYSTEM + ERRCODE_MULTIPLEIDAPI);
  2869.  
  2870.   DBIERR_CANTFINDODAPI = DBIERR_CANTFINDIDAPI;
  2871.   DBIERR_CANTLOADODAPI = DBIERR_CANTLOADIDAPI;
  2872.  
  2873. {  ERRCAT_NOTFOUND }
  2874. {  =============== }
  2875.  
  2876.   ERRCODE_BOF                   = 1;      { Beginning of Virtual table }
  2877.   ERRCODE_EOF                   = 2;      { End of Virtual table }
  2878.   ERRCODE_RECMOVED              = 3;      { Fly-away }
  2879.   ERRCODE_KEYORRECDELETED       = 4;      { Record Deleted/Key Modified }
  2880.   ERRCODE_NOCURRREC             = 5;      { No current record }
  2881.   ERRCODE_RECNOTFOUND           = 6;      { Record was not found }
  2882.   ERRCODE_ENDOFBLOB             = 7;      { End of Blob reached }
  2883.   ERRCODE_OBJNOTFOUND           = 8;      { Generic Not found }
  2884.   ERRCODE_FMLMEMBERNOTFOUND     = 9;      { Family member not found }
  2885.   ERRCODE_BLOBFILEMISSING       = 10;     { 0x0a Blob file for table is missing }
  2886.   ERRCODE_LDNOTFOUND            = 11;     { 0x0b Language driver not found }
  2887.  
  2888.   DBIERR_BOF                    = (ERRBASE_NOTFOUND + ERRCODE_BOF);
  2889.   DBIERR_EOF                    = (ERRBASE_NOTFOUND + ERRCODE_EOF);
  2890.   DBIERR_RECMOVED               = (ERRBASE_NOTFOUND + ERRCODE_RECMOVED);
  2891.   DBIERR_RECDELETED             = (ERRBASE_NOTFOUND + ERRCODE_KEYORRECDELETED);
  2892.   DBIERR_KEYORRECDELETED        = (ERRBASE_NOTFOUND + ERRCODE_KEYORRECDELETED);
  2893.   DBIERR_NOCURRREC              = (ERRBASE_NOTFOUND + ERRCODE_NOCURRREC);
  2894.   DBIERR_RECNOTFOUND            = (ERRBASE_NOTFOUND + ERRCODE_RECNOTFOUND);
  2895.   DBIERR_ENDOFBLOB              = (ERRBASE_NOTFOUND + ERRCODE_ENDOFBLOB);
  2896.   DBIERR_OBJNOTFOUND            = (ERRBASE_NOTFOUND + ERRCODE_OBJNOTFOUND);
  2897.   DBIERR_FMLMEMBERNOTFOUND      = (ERRBASE_NOTFOUND + ERRCODE_FMLMEMBERNOTFOUND);
  2898.   DBIERR_BLOBFILEMISSING        = (ERRBASE_NOTFOUND + ERRCODE_BLOBFILEMISSING);
  2899.   DBIERR_LDNOTFOUND             = (ERRBASE_NOTFOUND + ERRCODE_LDNOTFOUND);
  2900.  
  2901. { ERRCAT_DATACORRUPT }
  2902. { ================== }
  2903.  
  2904.   ERRCODE_HEADERCORRUPT         = 1;      { Corrupt Header }
  2905.   ERRCODE_FILECORRUPT           = 2;      { File corrupt - other than header }
  2906.   ERRCODE_MEMOCORRUPT           = 3;      { Memo file corrupted }
  2907.   ERRCODE_BMPCORRUPT            = 4;      { BitMap is corrupt (Internal error) }
  2908.   ERRCODE_INDEXCORRUPT          = 5;      { Index is corrupt }
  2909.   ERRCODE_CORRUPTLOCKFILE       = 6;      { Corrupt lock file }
  2910.   ERRCODE_FAMFILEINVALID        = 7;      { Corrupt family file }
  2911.   ERRCODE_VALFILECORRUPT        = 8;      { Val file is missing or corrupt }
  2912.   ERRCODE_FOREIGNINDEX          = 9;      { Index is in a foreign format - import first }
  2913.  
  2914.  
  2915.   DBIERR_HEADERCORRUPT          = (ERRBASE_DATACORRUPT + ERRCODE_HEADERCORRUPT);
  2916.   DBIERR_FILECORRUPT            = (ERRBASE_DATACORRUPT + ERRCODE_FILECORRUPT);
  2917.   DBIERR_MEMOCORRUPT            = (ERRBASE_DATACORRUPT + ERRCODE_MEMOCORRUPT);
  2918.   DBIERR_BMPCORRUPT             = (ERRBASE_DATACORRUPT + ERRCODE_BMPCORRUPT);
  2919.   DBIERR_INDEXCORRUPT           = (ERRBASE_DATACORRUPT + ERRCODE_INDEXCORRUPT);
  2920.   DBIERR_CORRUPTLOCKFILE        = (ERRBASE_DATACORRUPT + ERRCODE_CORRUPTLOCKFILE);
  2921.   DBIERR_FAMFILEINVALID         = (ERRBASE_DATACORRUPT + ERRCODE_FAMFILEINVALID);
  2922.   DBIERR_VALFILECORRUPT         = (ERRBASE_DATACORRUPT + ERRCODE_VALFILECORRUPT);
  2923.   DBIERR_FOREIGNINDEX           = (ERRBASE_DATACORRUPT + ERRCODE_FOREIGNINDEX);
  2924.  
  2925.  
  2926. { ERRCAT_IO }
  2927. { ========= }
  2928.  
  2929.   ERRCODE_READERR               = 1;      { Read failure (not expected) }
  2930.   ERRCODE_WRITEERR              = 2;      { Write failure (not expected) }
  2931.   ERRCODE_DIRNOACCESS           = 3;      { No access to dir }
  2932.   ERRCODE_FILEDELETEFAIL        = 4;      { File delete failed }
  2933.   ERRCODE_FILENOACCESS          = 5;      { No access to file }
  2934.   ERRCODE_ACCESSDISABLED        = 6;      { Access to table disabled (previous error) }
  2935.  
  2936.   DBIERR_READERR                = (ERRBASE_IO + ERRCODE_READERR);
  2937.   DBIERR_WRITEERR               = (ERRBASE_IO + ERRCODE_WRITEERR);
  2938.   DBIERR_DIRNOACCESS            = (ERRBASE_IO + ERRCODE_DIRNOACCESS);
  2939.   DBIERR_FILEDELETEFAIL         = (ERRBASE_IO + ERRCODE_FILEDELETEFAIL);
  2940.   DBIERR_FILENOACCESS           = (ERRBASE_IO + ERRCODE_FILENOACCESS);
  2941.   DBIERR_ACCESSDISABLED         = (ERRBASE_IO + ERRCODE_ACCESSDISABLED);
  2942.  
  2943. { ERRCAT_LIMIT }
  2944. { ============ }
  2945.  
  2946.   ERRCODE_NOMEMORY              = 1;      { Not enough Memory for this op }
  2947.   ERRCODE_NOFILEHANDLES         = 2;      { Not enough File handles }
  2948.   ERRCODE_NODISKSPACE           = 3;      { Not enough Disk space }
  2949.   ERRCODE_NOTEMPTBLSPACE        = 4;      { Temporary Table resource limit }
  2950.   ERRCODE_RECTOOBIG             = 5;      { Too big a record size for table }
  2951.   ERRCODE_CURSORLIMIT           = 6;      { Too many open cursors }
  2952.   ERRCODE_TABLEFULL             = 7;      { Table is full }
  2953.   ERRCODE_WSSESLIMIT            = 8;      { Too many sessions from this WS }
  2954.   ERRCODE_SERNUMLIMIT           = 9;      { Serial number limit (paradox) }
  2955.   ERRCODE_INTERNALLIMIT         = 10;     { 0x0a Some internal limit (see context) }
  2956.   ERRCODE_OPENTBLLIMIT          = 11;     { 0x0b Too many open tables }
  2957.   ERRCODE_TBLCURSORLIMIT        = 12;     { 0x0c Too many cursors per table }
  2958.   ERRCODE_RECLOCKLIMIT          = 13;     { 0x0d Too many record locks on table }
  2959.   ERRCODE_CLIENTSLIMIT          = 14;     { 0x0e Too many clients }
  2960.   ERRCODE_INDEXLIMIT            = 15;     { 0x0f Too many indexes (also in Table Create) }
  2961.   ERRCODE_SESSIONSLIMIT         = 16;     { 0x10 Too many sessions }
  2962.   ERRCODE_DBLIMIT               = 17;     { 0x11 Too many databases }
  2963.   ERRCODE_PASSWORDLIMIT         = 18;     { 0x12 Too many passwords }
  2964.   ERRCODE_DRIVERLIMIT           = 19;     { 0x13 Too many active drivers }
  2965.   ERRCODE_FLDLIMIT              = 20;     { 0x14 Too many Fields in Table Create }
  2966.   ERRCODE_TBLLOCKLIMIT          = 21;     { 0x15 Too many table locks }
  2967.   ERRCODE_OPENBLOBLIMIT         = 22;     { 0x16 Too many open blobs }
  2968.   ERRCODE_LOCKFILELIMIT         = 23;     { 0x17 Lock file has grown too big }
  2969.   ERRCODE_OPENQRYLIMIT          = 24;     { 0x18 Too many open queries }
  2970.   ERRCODE_THREADLIMIT           = 25;     { 0x19 Too many threads for client }
  2971.   ERRCODE_BLOBLIMIT             = 26;     { 0x1a Too many blobs }
  2972.   ERRCODE_PDX50NAMELIMIT        = 27;     { 0x1b Pathname is too long for a Paradox 5.0 or less table }
  2973.   ERRCODE_ROWFETCHLIMIT         = 28;     { 0x1c Row fetch limit }
  2974.   ERRCODE_LONGNAMENOTALLOWED    = 29;     { 0x1d Long name is not allowed for this tableversion }
  2975.  
  2976.   DBIERR_NOMEMORY               = (ERRBASE_LIMIT + ERRCODE_NOMEMORY);
  2977.   DBIERR_NOFILEHANDLES          = (ERRBASE_LIMIT + ERRCODE_NOFILEHANDLES);
  2978.   DBIERR_NODISKSPACE            = (ERRBASE_LIMIT + ERRCODE_NODISKSPACE);
  2979.   DBIERR_NOTEMPTBLSPACE         = (ERRBASE_LIMIT + ERRCODE_NOTEMPTBLSPACE);
  2980.   DBIERR_RECTOOBIG              = (ERRBASE_LIMIT + ERRCODE_RECTOOBIG);
  2981.   DBIERR_CURSORLIMIT            = (ERRBASE_LIMIT + ERRCODE_CURSORLIMIT);
  2982.   DBIERR_TABLEFULL              = (ERRBASE_LIMIT + ERRCODE_TABLEFULL);
  2983.   DBIERR_WSSESLIMIT             = (ERRBASE_LIMIT + ERRCODE_WSSESLIMIT);
  2984.   DBIERR_SERNUMLIMIT            = (ERRBASE_LIMIT + ERRCODE_SERNUMLIMIT);
  2985.   DBIERR_INTERNALLIMIT          = (ERRBASE_LIMIT + ERRCODE_INTERNALLIMIT);
  2986.   DBIERR_OPENTBLLIMIT           = (ERRBASE_LIMIT + ERRCODE_OPENTBLLIMIT);
  2987.   DBIERR_TBLCURSORLIMIT         = (ERRBASE_LIMIT + ERRCODE_TBLCURSORLIMIT);
  2988.   DBIERR_RECLOCKLIMIT           = (ERRBASE_LIMIT + ERRCODE_RECLOCKLIMIT);
  2989.   DBIERR_CLIENTSLIMIT           = (ERRBASE_LIMIT + ERRCODE_CLIENTSLIMIT);
  2990.   DBIERR_INDEXLIMIT             = (ERRBASE_LIMIT + ERRCODE_INDEXLIMIT);
  2991.   DBIERR_SESSIONSLIMIT          = (ERRBASE_LIMIT + ERRCODE_SESSIONSLIMIT);
  2992.   DBIERR_DBLIMIT                = (ERRBASE_LIMIT + ERRCODE_DBLIMIT);
  2993.   DBIERR_PASSWORDLIMIT          = (ERRBASE_LIMIT + ERRCODE_PASSWORDLIMIT);
  2994.   DBIERR_DRIVERLIMIT            = (ERRBASE_LIMIT + ERRCODE_DRIVERLIMIT);
  2995.   DBIERR_FLDLIMIT               = (ERRBASE_LIMIT + ERRCODE_FLDLIMIT);
  2996.   DBIERR_TBLLOCKLIMIT           = (ERRBASE_LIMIT + ERRCODE_TBLLOCKLIMIT);
  2997.   DBIERR_OPENBLOBLIMIT          = (ERRBASE_LIMIT + ERRCODE_OPENBLOBLIMIT);
  2998.   DBIERR_LOCKFILELIMIT          = (ERRBASE_LIMIT + ERRCODE_LOCKFILELIMIT);
  2999.   DBIERR_OPENQRYLIMIT           = (ERRBASE_LIMIT + ERRCODE_OPENQRYLIMIT);
  3000.   DBIERR_THREADLIMIT            = (ERRBASE_LIMIT + ERRCODE_THREADLIMIT);
  3001.   DBIERR_BLOBLIMIT              = (ERRBASE_LIMIT + ERRCODE_BLOBLIMIT);
  3002.   DBIERR_PDX50NAMELIMIT         = (ERRBASE_LIMIT + ERRCODE_PDX50NAMELIMIT);
  3003.   DBIERR_ROWFETCHLIMIT          = (ERRBASE_LIMIT + ERRCODE_ROWFETCHLIMIT);
  3004.   DBIERR_LONGNAMENOTALLOWED     = (ERRBASE_LIMIT + ERRCODE_LONGNAMENOTALLOWED);
  3005.  
  3006.  
  3007. { ERRCAT_INTEGRITY }
  3008. { ================ }
  3009.  
  3010.   ERRCODE_KEYVIOL               = 1;      { Key violation }
  3011.   ERRCODE_MINVALERR             = 2;      { Min val check failed }
  3012.   ERRCODE_MAXVALERR             = 3;      { Max val check failed }
  3013.   ERRCODE_REQDERR               = 4;      { Field value required }
  3014.   ERRCODE_FORIEGNKEYERR         = 5;      { Master record missing }
  3015.   ERRCODE_DETAILRECORDSEXIST    = 6;      { Cannot MODIFY or DELETE this Master record }
  3016.   ERRCODE_MASTERTBLLEVEL        = 7;      { Master Table Level is incorrect }
  3017.   ERRCODE_LOOKUPTABLEERR        = 8;      { Field value out of lookup tbl range }
  3018.   ERRCODE_LOOKUPTBLOPENERR      = 9;      { Lookup Table Open failed }
  3019.   ERRCODE_DETAILTBLOPENERR      = 10;     { 0x0a Detail Table Open failed }
  3020.   ERRCODE_MASTERTBLOPENERR      = 11;     { 0x0b Master Table Open failed }
  3021.   ERRCODE_FIELDISBLANK          = 12;     { 0x0c Field is blank }
  3022.  
  3023.   ERRCODE_MASTEREXISTS          = 13;     { 0x0d Master Table exists }
  3024.   ERRCODE_MASTERTBLOPEN         = 14;     { 0x0e Master Table is open }
  3025.  
  3026.   ERRCODE_DETAILTABLESEXIST     = 15;     { 0x0f Detail Tables exist ( cannot delete, rename ... ) }
  3027.   ERRCODE_DETAILRECEXISTEMPTY   = 16;     { 0x10 Cannot empty because details exist }
  3028.   ERRCODE_MASTERREFERENCEERR    = 17;     { 0x11 Cannot modify while adding self referencing Referential Integrity }
  3029.   ERRCODE_DETAILTBLOPEN         = 18;     { 0x12 Detail Table is opened }
  3030.   ERRCODE_DEPENDENTSMUSTBEEMPTY = 19;     { 0x13 Cannot make a master a detail of another table if its details are not empty. }
  3031.   ERRCODE_RINTREQINDEX          = 20;     { 0x14 Ref. integrity fields must be indexed }
  3032.   ERRCODE_LINKEDTBLPROTECTED    = 21;     { 0x15 Master Table is protected ( requires password to open) }
  3033.   ERRCODE_FIELDMULTILINKED      = 22;     { 0x16 Field has more than one master }
  3034.   ERRCODE_EXPRVALERR            = 23;     { 0x17 Expr val check failed }
  3035.  
  3036.   DBIERR_KEYVIOL                = (ERRBASE_INTEGRITY + ERRCODE_KEYVIOL);
  3037.   DBIERR_MINVALERR              = (ERRBASE_INTEGRITY + ERRCODE_MINVALERR);
  3038.   DBIERR_MAXVALERR              = (ERRBASE_INTEGRITY + ERRCODE_MAXVALERR);
  3039.   DBIERR_REQDERR                = (ERRBASE_INTEGRITY + ERRCODE_REQDERR);
  3040.   DBIERR_FORIEGNKEYERR          = (ERRBASE_INTEGRITY + ERRCODE_FORIEGNKEYERR);
  3041.   DBIERR_DETAILRECORDSEXIST     = (ERRBASE_INTEGRITY + ERRCODE_DETAILRECORDSEXIST);
  3042.   DBIERR_MASTERTBLLEVEL         = (ERRBASE_INTEGRITY + ERRCODE_MASTERTBLLEVEL);
  3043.   DBIERR_LOOKUPTABLEERR         = (ERRBASE_INTEGRITY + ERRCODE_LOOKUPTABLEERR);
  3044.   DBIERR_LOOKUPTBLOPENERR       = (ERRBASE_INTEGRITY + ERRCODE_LOOKUPTBLOPENERR);
  3045.   DBIERR_DETAILTBLOPENERR       = (ERRBASE_INTEGRITY + ERRCODE_DETAILTBLOPENERR);
  3046.   DBIERR_MASTERTBLOPENERR       = (ERRBASE_INTEGRITY + ERRCODE_MASTERTBLOPENERR);
  3047.   DBIERR_FIELDISBLANK           = (ERRBASE_INTEGRITY + ERRCODE_FIELDISBLANK);
  3048.   DBIERR_MASTEREXISTS           = (ERRBASE_INTEGRITY + ERRCODE_MASTEREXISTS);
  3049.   DBIERR_MASTERTBLOPEN          = (ERRBASE_INTEGRITY + ERRCODE_MASTERTBLOPEN);
  3050.   DBIERR_DETAILTABLESEXIST      = (ERRBASE_INTEGRITY + ERRCODE_DETAILTABLESEXIST);
  3051.   DBIERR_DETAILRECEXISTEMPTY    = (ERRBASE_INTEGRITY + ERRCODE_DETAILRECEXISTEMPTY);
  3052.   DBIERR_MASTERREFERENCEERR     = (ERRBASE_INTEGRITY + ERRCODE_MASTERREFERENCEERR);
  3053.   DBIERR_DETAILTBLOPEN          = (ERRBASE_INTEGRITY + ERRCODE_DETAILTBLOPEN);
  3054.   DBIERR_DEPENDENTSMUSTBEEMPTY  = (ERRBASE_INTEGRITY + ERRCODE_DEPENDENTSMUSTBEEMPTY);
  3055.   DBIERR_RINTREQINDEX           = (ERRBASE_INTEGRITY + ERRCODE_RINTREQINDEX);
  3056.   DBIERR_LINKEDTBLPROTECTED     = (ERRBASE_INTEGRITY + ERRCODE_LINKEDTBLPROTECTED);
  3057.   DBIERR_FIELDMULTILINKED       = (ERRBASE_INTEGRITY + ERRCODE_FIELDMULTILINKED);
  3058.   DBIERR_EXPRVALERR             = (ERRBASE_INTEGRITY + ERRCODE_EXPRVALERR);
  3059.  
  3060.  
  3061. { ERRCAT_INVALIDREQ }
  3062. { ================= }
  3063.  
  3064.   ERRCODE_OUTOFRANGE            = 1;      { Number out of range (e.g field no) }
  3065.   ERRCODE_INVALIDPARAM          = 2;      { Generic invalid parameter }
  3066.   ERRCODE_INVALIDFILENAME       = 3;      { Invalid file name }
  3067.   ERRCODE_NOSUCHFILE            = 4;      { No such file }
  3068.   ERRCODE_INVALIDOPTION         = 5;      { Invalid option for a parameter }
  3069.   ERRCODE_INVALIDHNDL           = 6;      { Invalid handle to the function }
  3070.   ERRCODE_UNKNOWNTBLTYPE        = 7;      { Table type given not known }
  3071.   ERRCODE_UNKNOWNFILE           = 8;      { Dont know how to open file }
  3072.   ERRCODE_PRIMARYKEYREDEFINE    = 9;      { Cannot redefine primary key }
  3073.   ERRCODE_INVALIDRINTDESCNUM    = 10;     { 0x0a Cannot change this RINTDesc }
  3074.   ERRCODE_KEYFLDTYPEMISMATCH    = 11;     { 0x0b Foreign & Primary Key Mismatch }
  3075.   ERRCODE_INVALIDMODIFYREQUEST  = 12;     { 0x0c Invalid modify request }
  3076.   ERRCODE_NOSUCHINDEX           = 13;     { 0x0d Index does not exist }
  3077.   ERRCODE_INVALIDBLOBOFFSET     = 14;     { 0x0e Invalid Offset into the Blob }
  3078.   ERRCODE_INVALIDDESCNUM        = 15;     { 0x0f Invalid descriptor number }
  3079.   ERRCODE_INVALIDFLDTYPE        = 16;     { 0x10 Invalid field type }
  3080.   ERRCODE_INVALIDFLDDESC        = 17;     { 0x11 Invalid field descriptor }
  3081.   ERRCODE_INVALIDFLDXFORM       = 18;     { 0x12 Invalid field transform }
  3082.   ERRCODE_INVALIDRECSTRUCT      = 19;     { 0x13 Invalid record structure }
  3083.   ERRCODE_INVALIDDESC           = 20;     { 0x14 Generic: invalid descriptor }
  3084.   ERRCODE_INVALIDINDEXSTRUCT    = 21;     { 0x15 Invalid array of indexes descriptors }
  3085.   ERRCODE_INVALIDVCHKSTRUCT     = 22;     { 0x16 Invalid array of  val. check descriptors }
  3086.   ERRCODE_INVALIDRINTSTRUCT     = 23;     { 0x17 Invalid array of ref. integrity descriptors }
  3087.   ERRCODE_INVALIDRESTRTBLORDER  = 24;     { 0x18 Invalid ordering of tables during restructure }
  3088.   ERRCODE_NAMENOTUNIQUE         = 25;     { 0x19 Name not unique in this context }
  3089.   ERRCODE_INDEXNAMEREQUIRED     = 26;     { 0x1a Index name required }
  3090.   ERRCODE_INVALIDSESHANDLE      = 27;     { 0x1b Invalid ses handle }
  3091.   ERRCODE_INVALIDRESTROP        = 28;     { 0x1c Invalid restructure operation }
  3092.   ERRCODE_UNKNOWNDRIVER         = 29;     { 0x1d Driver not known to system }
  3093.   ERRCODE_UNKNOWNDB             = 30;     { 0x1e Unknown db }
  3094.   ERRCODE_INVALIDPASSWORD       = 31;     { 0x1f Invalid password given }
  3095.   ERRCODE_NOCALLBACK            = 32;     { 0x20 No callback function }
  3096.   ERRCODE_INVALIDCALLBACKBUFLEN = 33;     { 0x21 Invalid callback buffer length }
  3097.   ERRCODE_INVALIDDIR            = 34;     { 0x22 Invalid directory }
  3098.   ERRCODE_INVALIDXLATION        = 35;     { 0x23 Translate Error - Translate DID NOT happen }
  3099.   ERRCODE_DIFFERENTTABLES       = 36;     { 0x24 Cannot Set Cursor of one Table to another }
  3100.   ERRCODE_INVALIDBOOKMARK       = 37;     { 0x25 Bookmarks does not match table, etc. }
  3101.   ERRCODE_INVALIDINDEXNAME      = 38;     { 0x26 Index/Tag Name is invalid }
  3102.   ERRCODE_INVALIDIDXDESC        = 39;     { 0x27 Invalid index descriptor }
  3103.   ERRCODE_NOSUCHTABLE           = 40;     { 0x28 No such table }
  3104.   ERRCODE_USECOUNT              = 41;     { 0x29 Table has too many users }
  3105.   ERRCODE_INVALIDKEY            = 42;     { 0x2a Key does not pass filter condition }
  3106.   ERRCODE_INDEXEXISTS           = 43;     { 0x2b Index already exists }
  3107.   ERRCODE_INDEXOPEN             = 44;     { 0x2c Index is open }
  3108.   ERRCODE_INVALIDBLOBLEN        = 45;     { 0x2d Invalid Blob Length }
  3109.   ERRCODE_INVALIDBLOBHANDLE     = 46;     { 0x2e Invalid Blob handle (in record buffer) }
  3110.   ERRCODE_TABLEOPEN             = 47;     { 0x2f Table is open }
  3111.   ERRCODE_NEEDRESTRUCTURE       = 48;     { 0x30 Need to do (hard) restructure }
  3112.   ERRCODE_INVALIDMODE           = 49;     { 0x31 Invalid mode }
  3113.   ERRCODE_CANNOTCLOSE           = 50;     { 0x32 Cannot close index }
  3114.   ERRCODE_ACTIVEINDEX           = 51;     { 0x33 Index is being used to order tbl }
  3115.   ERRCODE_INVALIDUSRPASS        = 52;     { 0x34 Bad user name or password }
  3116.   ERRCODE_MULTILEVELCASCADE     = 53;     { 0x35 Multi level Cascade not supported }
  3117.   ERRCODE_INVALIDFIELDNAME      = 54;     { 0x36 Invalid field name }
  3118.   ERRCODE_INVALIDTABLENAME      = 55;     { 0x37 Invalid table name }
  3119.   ERRCODE_INVALIDLINKEXPR       = 56;     { 0x38 Invalid linked cursor expression }
  3120.   ERRCODE_NAMERESERVED          = 57;     { 0x39 Name is reserved }
  3121.   ERRCODE_INVALIDFILEEXTN       = 58;     { 0x3a Invalid file extention }
  3122.   ERRCODE_INVALIDLANGDRV        = 59;     { 0x3b Invalid language driver }
  3123.   ERRCODE_ALIASNOTOPEN          = 60;     { 0x3c Requested alias in not open }
  3124.   ERRCODE_INCOMPATRECSTRUCTS    = 61;     { 0x3d Incompatible record structures }
  3125.   ERRCODE_RESERVEDDOSNAME       = 62;     { 0x3e Reserved dos name }
  3126.   ERRCODE_DESTMUSTBEINDEXED     = 63;     { 0x3f Destination must be indexed }
  3127.   ERRCODE_INVALIDINDEXTYPE      = 64;     { 0x40 Invalid index type }
  3128.   ERRCODE_LANGDRVMISMATCH       = 65;     { 0x41 Language driver of table and index do not match }
  3129.   ERRCODE_NOSUCHFILTER          = 66;     { 0x42 Filter handle is invalid }
  3130.   ERRCODE_INVALIDFILTER         = 67;     { 0x43 Invalid filter }
  3131.  
  3132.   ERRCODE_INVALIDTABLECREATE    = 68;     { 0x44 Bad table create request (exact prob unknown) }
  3133.   ERRCODE_INVALIDTABLEDELETE    = 69;     { 0x45 Bad table delete request (exact prob unknown) }
  3134.   ERRCODE_INVALIDINDEXCREATE    = 70;     { 0x46 Bad index create request (exact prob unknown) }
  3135.   ERRCODE_INVALIDINDEXDELETE    = 71;     { 0x47 Bad index delete request (exact prob unknown) }
  3136.   ERRCODE_INVALIDTABLE          = 72;     { 0x48 Invalid table name specified }
  3137.   ERRCODE_MULTIRESULTS          = 73;     { 0X49 Multi results }
  3138.   ERRCODE_INVALIDTIME           = 74;     { 0X4A Multi results }
  3139.   ERRCODE_INVALIDDATE           = 75;     { 0X4B Multi results }
  3140.   ERRCODE_INVALIDTIMESTAMP      = 76;     { 0X4C Multi results }
  3141.   ERRCODE_DIFFERENTPATH         = 77;     { 0X4d Tables in different paths }
  3142.   ERRCODE_MISMATCHARGS          = 78;     { 0x4e MisMatch in the # of arguments }
  3143.   ERRCODE_FUNCTIONNOTFOUND      = 79;     { 0x4f Loaderlib cant find a func in the DLL (bad version?) }
  3144.   ERRCODE_MUSTUSEBASEORDER      = 80;     { 0x50 Must use baseorder for this operation }
  3145.   ERRCODE_INVALIDPROCEDURENAME  = 81;     { 0x51 Invalid procedure name }
  3146.   ERRCODE_INVALIDFLDMAP         = 82;     { 0x52 invalid field map }
  3147.  
  3148.  
  3149.   DBIERR_OUTOFRANGE             = (ERRBASE_INVALIDREQ + ERRCODE_OUTOFRANGE);
  3150.   DBIERR_INVALIDPARAM           = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDPARAM);
  3151.   DBIERR_INVALIDFILENAME        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFILENAME);
  3152.   DBIERR_NOSUCHFILE             = (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHFILE);
  3153.   DBIERR_INVALIDOPTION          = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDOPTION);
  3154.   DBIERR_INVALIDHNDL            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDHNDL);
  3155.   DBIERR_UNKNOWNTBLTYPE         = (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNTBLTYPE);
  3156.   DBIERR_UNKNOWNFILE            = (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNFILE);
  3157.   DBIERR_PRIMARYKEYREDEFINE     = (ERRBASE_INVALIDREQ + ERRCODE_PRIMARYKEYREDEFINE);
  3158.   DBIERR_INVALIDRINTDESCNUM     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRINTDESCNUM);
  3159.   DBIERR_KEYFLDTYPEMISMATCH     = (ERRBASE_INVALIDREQ + ERRCODE_KEYFLDTYPEMISMATCH);
  3160.   DBIERR_INVALIDMODIFYREQUEST   = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDMODIFYREQUEST);
  3161.   DBIERR_NOSUCHINDEX            = (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHINDEX);
  3162.   DBIERR_INVALIDBLOBOFFSET      = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBLOBOFFSET);
  3163.   DBIERR_INVALIDDESCNUM         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDESCNUM);
  3164.   DBIERR_INVALIDFLDTYPE         = (ERRBASE_INVALIDREQ +  ERRCODE_INVALIDFLDTYPE);
  3165.   DBIERR_INVALIDFLDDESC         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFLDDESC);
  3166.   DBIERR_INVALIDFLDXFORM        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFLDXFORM);
  3167.   DBIERR_INVALIDRECSTRUCT       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRECSTRUCT);
  3168.   DBIERR_INVALIDDESC            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDESC);
  3169.   DBIERR_INVALIDINDEXSTRUCT     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXSTRUCT);
  3170.   DBIERR_INVALIDVCHKSTRUCT      = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDVCHKSTRUCT);
  3171.   DBIERR_INVALIDRINTSTRUCT      = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRINTSTRUCT);
  3172.   DBIERR_INVALIDRESTRTBLORDER   = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRESTRTBLORDER);
  3173.   DBIERR_NAMENOTUNIQUE          = (ERRBASE_INVALIDREQ + ERRCODE_NAMENOTUNIQUE);
  3174.   DBIERR_INDEXNAMEREQUIRED      = (ERRBASE_INVALIDREQ + ERRCODE_INDEXNAMEREQUIRED);
  3175.   DBIERR_INVALIDSESHANDLE       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDSESHANDLE);
  3176.   DBIERR_INVALIDRESTROP         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRESTROP);
  3177.   DBIERR_UNKNOWNDRIVER          = (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNDRIVER);
  3178.   DBIERR_UNKNOWNDB              = (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNDB);
  3179.   DBIERR_INVALIDPASSWORD        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDPASSWORD);
  3180.   DBIERR_NOCALLBACK             = (ERRBASE_INVALIDREQ + ERRCODE_NOCALLBACK);
  3181.   DBIERR_INVALIDCALLBACKBUFLEN  = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDCALLBACKBUFLEN );
  3182.   DBIERR_INVALIDDIR             = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDIR);
  3183.   DBIERR_INVALIDXLATION         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDXLATION);
  3184.   DBIERR_DIFFERENTTABLES        = (ERRBASE_INVALIDREQ + ERRCODE_DIFFERENTTABLES);
  3185.   DBIERR_INVALIDBOOKMARK        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBOOKMARK);
  3186.   DBIERR_INVALIDINDEXNAME       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXNAME);
  3187.   DBIERR_INVALIDIDXDESC         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDIDXDESC);
  3188.   DBIERR_NOSUCHTABLE            = (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHTABLE);
  3189.   DBIERR_USECOUNT               = (ERRBASE_INVALIDREQ + ERRCODE_USECOUNT);
  3190.   DBIERR_INVALIDKEY             = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDKEY);
  3191.   DBIERR_INDEXEXISTS            = (ERRBASE_INVALIDREQ + ERRCODE_INDEXEXISTS);
  3192.   DBIERR_INDEXOPEN              = (ERRBASE_INVALIDREQ + ERRCODE_INDEXOPEN);
  3193.   DBIERR_INVALIDBLOBLEN         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBLOBLEN);
  3194.   DBIERR_INVALIDBLOBHANDLE      = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBLOBHANDLE);
  3195.   DBIERR_TABLEOPEN              = (ERRBASE_INVALIDREQ + ERRCODE_TABLEOPEN);
  3196.   DBIERR_NEEDRESTRUCTURE        = (ERRBASE_INVALIDREQ + ERRCODE_NEEDRESTRUCTURE);
  3197.   DBIERR_INVALIDMODE            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDMODE);
  3198.   DBIERR_CANNOTCLOSE            = (ERRBASE_INVALIDREQ + ERRCODE_CANNOTCLOSE);
  3199.   DBIERR_ACTIVEINDEX            = (ERRBASE_INVALIDREQ + ERRCODE_ACTIVEINDEX);
  3200.   DBIERR_INVALIDUSRPASS         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDUSRPASS);
  3201.   DBIERR_MULTILEVELCASCADE      = (ERRBASE_INVALIDREQ + ERRCODE_MULTILEVELCASCADE);
  3202.   DBIERR_INVALIDFIELDNAME       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFIELDNAME);
  3203.   DBIERR_INVALIDTABLENAME       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLENAME);
  3204.   DBIERR_INVALIDLINKEXPR        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDLINKEXPR);
  3205.   DBIERR_NAMERESERVED           = (ERRBASE_INVALIDREQ + ERRCODE_NAMERESERVED);
  3206.   DBIERR_INVALIDFILEEXTN        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFILEEXTN);
  3207.   DBIERR_INVALIDLANGDRV         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDLANGDRV);
  3208.   DBIERR_ALIASNOTOPEN           = (ERRBASE_INVALIDREQ + ERRCODE_ALIASNOTOPEN);
  3209.   DBIERR_INCOMPATRECSTRUCTS     = (ERRBASE_INVALIDREQ + ERRCODE_INCOMPATRECSTRUCTS);
  3210.   DBIERR_RESERVEDOSNAME         = (ERRBASE_INVALIDREQ + ERRCODE_RESERVEDDOSNAME);
  3211.   DBIERR_DESTMUSTBEINDEXED      = (ERRBASE_INVALIDREQ + ERRCODE_DESTMUSTBEINDEXED);
  3212.   DBIERR_INVALIDINDEXTYPE       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXTYPE);
  3213.   DBIERR_LANGDRVMISMATCH        = (ERRBASE_INVALIDREQ + ERRCODE_LANGDRVMISMATCH);
  3214.   DBIERR_NOSUCHFILTER           = (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHFILTER);
  3215.   DBIERR_INVALIDFILTER          = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFILTER);
  3216.   DBIERR_INVALIDTABLECREATE     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLECREATE);
  3217.   DBIERR_INVALIDTABLEDELETE     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLEDELETE);
  3218.   DBIERR_INVALIDINDEXCREATE     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXCREATE);
  3219.   DBIERR_INVALIDINDEXDELETE     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXDELETE);
  3220.   DBIERR_INVALIDTABLE           = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLE);
  3221.   DBIERR_MULTIRESULTS           = (ERRBASE_INVALIDREQ + ERRCODE_MULTIRESULTS);
  3222.   DBIERR_INVALIDTIME            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTIME);
  3223.   DBIERR_INVALIDDATE            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDATE);
  3224.   DBIERR_INVALIDTIMESTAMP       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTIMESTAMP);
  3225.   DBIERR_DIFFERENTPATH          = (ERRBASE_INVALIDREQ + ERRCODE_DIFFERENTPATH);
  3226.   DBIERR_MISMATCHARGS           = (ERRBASE_INVALIDREQ + ERRCODE_MISMATCHARGS);
  3227.   DBIERR_FUNCTIONNOTFOUND       = (ERRBASE_INVALIDREQ + ERRCODE_FUNCTIONNOTFOUND);
  3228.   DBIERR_MUSTUSEBASEORDER       = (ERRBASE_INVALIDREQ + ERRCODE_MUSTUSEBASEORDER);
  3229.   DBIERR_INVALIDPROCEDURENAME   = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDPROCEDURENAME);
  3230.   DBIERR_INVALIDFLDMAP          = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFLDMAP);
  3231.  
  3232. { ERRCAT_LOCKCONFLICT }
  3233. { =================== }
  3234.  
  3235.   ERRCODE_LOCKED                = 1;
  3236.   ERRCODE_UNLOCKFAILED          = 2;
  3237.   ERRCODE_FILEBUSY              = 3;
  3238.   ERRCODE_DIRBUSY               = 4;
  3239.   ERRCODE_FILELOCKED            = 5;
  3240.   ERRCODE_DIRLOCKED             = 6;
  3241.   ERRCODE_ALREADYLOCKED         = 7;
  3242.   ERRCODE_NOTLOCKED             = 8;
  3243.   ERRCODE_LOCKTIMEOUT           = 9;
  3244.   ERRCODE_GROUPLOCKED           = 10;     { 0x0a }
  3245.   ERRCODE_LOSTTBLLOCK           = 11;     { 0x0b }
  3246.   ERRCODE_LOSTEXCLACCESS        = 12;     { 0x0c }
  3247.   ERRCODE_NEEDEXCLACCESS        = 13;     { 0x0d }
  3248.   ERRCODE_RECGROUPCONFLICT      = 14;     { 0x0e }
  3249.   ERRCODE_DEADLOCK              = 15;
  3250.   ERRCODE_ACTIVETRAN            = 16;
  3251.   ERRCODE_NOACTIVETRAN          = 17;
  3252.   ERRCODE_RECLOCKFAILED         = 18;
  3253.   ERRCODE_OPTRECLOCKFAILED      = 19;
  3254.   ERRCODE_OPTRECLOCKRECDEL      = 20;
  3255.   ERRCODE_LOCKEDRECS            = 21;
  3256.   ERRCODE_NEEDWRITELOCK         = 22;
  3257.  
  3258.   DBIERR_LOCKED                 = (ERRBASE_LOCKCONFLICT + ERRCODE_LOCKED);
  3259.   DBIERR_UNLOCKFAILED           = (ERRBASE_LOCKCONFLICT + ERRCODE_UNLOCKFAILED);
  3260.   DBIERR_FILEBUSY               = (ERRBASE_LOCKCONFLICT + ERRCODE_FILEBUSY);
  3261.   DBIERR_DIRBUSY                = (ERRBASE_LOCKCONFLICT + ERRCODE_DIRBUSY);
  3262.   DBIERR_FILELOCKED             = (ERRBASE_LOCKCONFLICT + ERRCODE_FILELOCKED);
  3263.   DBIERR_DIRLOCKED              = (ERRBASE_LOCKCONFLICT + ERRCODE_DIRLOCKED);
  3264.   DBIERR_ALREADYLOCKED          = (ERRBASE_LOCKCONFLICT + ERRCODE_ALREADYLOCKED);
  3265.   DBIERR_NOTLOCKED              = (ERRBASE_LOCKCONFLICT + ERRCODE_NOTLOCKED);
  3266.   DBIERR_LOCKTIMEOUT            = (ERRBASE_LOCKCONFLICT + ERRCODE_LOCKTIMEOUT);
  3267.   DBIERR_GROUPLOCKED            = (ERRBASE_LOCKCONFLICT + ERRCODE_GROUPLOCKED);
  3268.   DBIERR_LOSTTBLLOCK            = (ERRBASE_LOCKCONFLICT + ERRCODE_LOSTTBLLOCK);
  3269.   DBIERR_LOSTEXCLACCESS         = (ERRBASE_LOCKCONFLICT + ERRCODE_LOSTEXCLACCESS);
  3270.   DBIERR_NEEDEXCLACCESS         = (ERRBASE_LOCKCONFLICT  + ERRCODE_NEEDEXCLACCESS);
  3271.   DBIERR_RECGROUPCONFLICT       = (ERRBASE_LOCKCONFLICT + ERRCODE_RECGROUPCONFLICT);
  3272.   DBIERR_DEADLOCK               = (ERRBASE_LOCKCONFLICT + ERRCODE_DEADLOCK);
  3273.   DBIERR_ACTIVETRAN             = (ERRBASE_LOCKCONFLICT + ERRCODE_ACTIVETRAN);
  3274.   DBIERR_NOACTIVETRAN           = (ERRBASE_LOCKCONFLICT + ERRCODE_NOACTIVETRAN);
  3275.   DBIERR_RECLOCKFAILED          = (ERRBASE_LOCKCONFLICT + ERRCODE_RECLOCKFAILED);
  3276.   DBIERR_OPTRECLOCKFAILED       = (ERRBASE_LOCKCONFLICT + ERRCODE_OPTRECLOCKFAILED);
  3277.   DBIERR_OPTRECLOCKRECDEL       = (ERRBASE_LOCKCONFLICT + ERRCODE_OPTRECLOCKRECDEL);
  3278.  
  3279. { ERRCAT_SECURITY }
  3280. { =============== }
  3281.  
  3282.   ERRCODE_NOTSUFFFIELDRIGHTS    = 1;      { Not sufficient field  rights for operation }
  3283.   ERRCODE_NOTSUFFTABLERIGHTS    = 2;      { Not sufficient table  rights for operation }
  3284.   ERRCODE_NOTSUFFFAMILYRIGHTS   = 3;      { Not sufficient family rights for operation }
  3285.   ERRCODE_READONLYDIR           = 4;      { Is a read-only directory }
  3286.   ERRCODE_READONLYDB            = 5;      { Database is read-only }
  3287.   ERRCODE_READONLYFLD           = 6;      { Trying to modify read-only field }
  3288.   ERRCODE_TBLENCRYPTED          = 7;      { Table is encrypted (dBASE only) }
  3289.   ERRCODE_NOTSUFFSQLRIGHTS      = 8;      { Not sufficient sql rights for operation }
  3290.  
  3291.  
  3292.   DBIERR_NOTSUFFFIELDRIGHTS     = (ERRBASE_SEC + ERRCODE_NOTSUFFFIELDRIGHTS);
  3293.   DBIERR_NOTSUFFTABLERIGHTS     = (ERRBASE_SEC + ERRCODE_NOTSUFFTABLERIGHTS);
  3294.   DBIERR_NOTSUFFFAMILYRIGHTS    = (ERRBASE_SEC + ERRCODE_NOTSUFFFAMILYRIGHTS);
  3295.   DBIERR_READONLYDIR            = (ERRBASE_SEC + ERRCODE_READONLYDIR);
  3296.   DBIERR_READONLYDB             = (ERRBASE_SEC + ERRCODE_READONLYDB);
  3297.   DBIERR_READONLYFLD            = (ERRBASE_SEC + ERRCODE_READONLYFLD);
  3298.   DBIERR_TBLENCRYPTED           = (ERRBASE_SEC + ERRCODE_TBLENCRYPTED);
  3299.   DBIERR_NOTSUFFSQLRIGHTS       = (ERRBASE_SEC + ERRCODE_NOTSUFFSQLRIGHTS);
  3300.  
  3301.  
  3302. { ERRCAT_INVALIDCONTEXT }
  3303. { ===================== }
  3304.  
  3305.   ERRCODE_NOTABLOB              = 1;      { Field is not a blob }
  3306.   ERRCODE_BLOBOPENED            = 2;      { Blob already opened }
  3307.   ERRCODE_BLOBNOTOPENED         = 3;      { Blob not opened }
  3308.   ERRCODE_NA                    = 4;      { Operation not applicable }
  3309.   ERRCODE_NOTINDEXED            = 5;      { Table is not indexed }
  3310.   ERRCODE_NOTINITIALIZED        = 6;      { Engine not initialized }
  3311.   ERRCODE_MULTIPLEINIT          = 7;      { Attempt to re-initialize engine }
  3312.   ERRCODE_NOTSAMESESSION        = 8;      { Attempt to mix objs from diff ses }
  3313.   ERRCODE_PDXDRIVERNOTACTIVE    = 9;      { Paradox driver not active }
  3314.   ERRCODE_DRIVERNOTLOADED       = 10;     { 0x0a Driver not loaded }
  3315.   ERRCODE_TABLEREADONLY         = 11;     { 0x0b Table is read only }
  3316.   ERRCODE_NOASSOCINDEX          = 12;     { 0x0c No index associated with the cursor }
  3317.   ERRCODE_HASOPENCURSORS        = 13;     { 0x0d Has open cursors }
  3318.   ERRCODE_NOTABLESUPPORT        = 14;     { 0x0e Op cannot be done on this table }
  3319.   ERRCODE_INDEXREADONLY         = 15;     { 0x0f Index is read only }
  3320.   ERRCODE_NOUNIQUERECS          = 16;     { 0x10 Records are not unique }
  3321.   ERRCODE_NOTCURSESSION         = 17;     { 0x11 Not the current/active session }
  3322.   ERRCODE_INVALIDKEYWORD        = 18;     { 0x12 Invalid use of keyword. }
  3323.   ERRCODE_CONNECTINUSE          = 19;     { 0x13 Connection in use }
  3324.   ERRCODE_CONNECTNOTSHARED      = 20;     { 0x14 Passthru SQL connection not share }
  3325.  
  3326.  
  3327.   DBIERR_NOTABLOB               = (ERRBASE_IC + ERRCODE_NOTABLOB);
  3328.   DBIERR_BLOBOPENED             = (ERRBASE_IC + ERRCODE_BLOBOPENED);
  3329.   DBIERR_BLOBNOTOPENED          = (ERRBASE_IC + ERRCODE_BLOBNOTOPENED);
  3330.   DBIERR_NA                     = (ERRBASE_IC + ERRCODE_NA);
  3331.   DBIERR_NOTINDEXED             = (ERRBASE_IC + ERRCODE_NOTINDEXED);
  3332.   DBIERR_NOTINITIALIZED         = (ERRBASE_IC + ERRCODE_NOTINITIALIZED);
  3333.   DBIERR_MULTIPLEINIT           = (ERRBASE_IC + ERRCODE_MULTIPLEINIT);
  3334.   DBIERR_NOTSAMESESSION         = (ERRBASE_IC + ERRCODE_NOTSAMESESSION);
  3335.   DBIERR_PDXDRIVERNOTACTIVE     = (ERRBASE_IC + ERRCODE_PDXDRIVERNOTACTIVE);
  3336.   DBIERR_DRIVERNOTLOADED        = (ERRBASE_IC + ERRCODE_DRIVERNOTLOADED);
  3337.   DBIERR_TABLEREADONLY          = (ERRBASE_IC + ERRCODE_TABLEREADONLY);
  3338.   DBIERR_NOASSOCINDEX           = (ERRBASE_IC + ERRCODE_NOASSOCINDEX);
  3339.   DBIERR_HASOPENCURSORS         = (ERRBASE_IC + ERRCODE_HASOPENCURSORS);
  3340.   DBIERR_NOTABLESUPPORT         = (ERRBASE_IC + ERRCODE_NOTABLESUPPORT);
  3341.   DBIERR_INDEXREADONLY          = (ERRBASE_IC + ERRCODE_INDEXREADONLY);
  3342.   DBIERR_NOUNIQUERECS           = (ERRBASE_IC + ERRCODE_NOUNIQUERECS);
  3343.   DBIERR_NOTCURSESSION          = (ERRBASE_IC + ERRCODE_NOTCURSESSION);
  3344.   DBIERR_INVALIDKEYWORD         = (ERRBASE_IC + ERRCODE_INVALIDKEYWORD);
  3345.   DBIERR_CONNECTINUSE           = (ERRBASE_IC + ERRCODE_CONNECTINUSE);
  3346.   DBIERR_CONNECTNOTSHARED       = (ERRBASE_IC + ERRCODE_CONNECTNOTSHARED);
  3347.  
  3348.  
  3349. { ERRCAT_OS }
  3350. { ========= }
  3351. { DOS extended errors: }
  3352.  
  3353.   ERRCODE_OSEINVFNC             = 1;      { Invalid function number }
  3354.   ERRCODE_OSENOENT              = 2;      { No such file or directory }
  3355.   ERRCODE_OSENOPATH             = 3;      { Path not found }
  3356.   ERRCODE_OSEMFILE              = 4;      { Too many open files }
  3357.   ERRCODE_OSEACCES              = 5;      { Permission denied }
  3358.   ERRCODE_OSEBADF               = 6;      { Bad file number }
  3359.   ERRCODE_OSECONTR              = 7;      { Memory blocks destroyed }
  3360.   ERRCODE_OSENOMEM              = 8;      { Not enough core }
  3361.   ERRCODE_OSEINVMEM             = 9;      { Invalid memory block address }
  3362.   ERRCODE_OSEINVENV             = 10;     { 0x0a Invalid environment }
  3363.   ERRCODE_OSEINVFMT             = 11;     { 0x0b Invalid format }
  3364.   ERRCODE_OSEINVACC             = 12;     { 0x0c Invalid access code }
  3365.   ERRCODE_OSEINVDAT             = 13;     { 0x0d Invalid data }
  3366.   ERRCODE_OSENODEV              = 15;     { 0x0f No such device }
  3367.   ERRCODE_OSECURDIR             = 16;     { 0x10 Attempt to remove curdir }
  3368.   ERRCODE_OSENOTSAM             = 17;     { 0x11 Not same device }
  3369.   ERRCODE_OSENMFILE             = 18;     { 0x12 No more files }
  3370.   ERRCODE_OSEINVAL              = 19;     { 0x13 Invalid argument }
  3371.   ERRCODE_OSE2BIG               = 20;     { 0x14 Arg list too long }
  3372.   ERRCODE_OSENOEXEC             = 21;     { 0x15 Exec format error }
  3373.   ERRCODE_OSEXDEV               = 22;     { 0x16 Cross-device link }
  3374.   ERRCODE_OSEDOM                = 33;     { 0x21 Math argument }
  3375.   ERRCODE_OSERANGE              = 34;     { 0x22 Result to large }
  3376.   ERRCODE_OSEEXIST              = 35;     { 0x23 File already exists }
  3377.   ERRCODE_OSUNKNOWN             = 39;     { 0x27 Unkown | illegal error from rtl }
  3378.  
  3379.   ERRCODE_OSSHAREVIOL           = 50;     { 0x32 Share viol, ext. err 0x20 }
  3380.   ERRCODE_OSLOCKVIOL            = 51;     { 0x33 Lock viol, ext. err 0x21 }
  3381.   ERRCODE_OSINT24FAIL           = 52;     { 0x34 INT24 called }
  3382.   ERRCODE_OSDRIVENOTREADY       = 53;     { 0x35 Drive not ready }
  3383.  
  3384.  
  3385.  
  3386. { OTHER Os errors: }
  3387. { 1. idapi errors  }
  3388. { 2. errors from non-dos systems ( i.e. NOVELL ) }
  3389.  
  3390.   ERRCODE_NOTEXACT              = 100;    { 0x64 Not exact read/write }
  3391.   ERRCODE_OSNETERR              = 101;    { 0x65 Generic network error }
  3392.   ERRCODE_OSUNKNOWNSRVERR       = 102;    { 0x66 Error from file server }
  3393.   ERRCODE_SERVERNOMEMORY        = 103;    { 0x67 Server out of memory }
  3394.   ERRCODE_OSALREADYLOCKED       = 104;    { 0x68 Record already locked (by you) }
  3395.   ERRCODE_OSNOTLOCKED           = 105;    { 0x69 Record not locked }
  3396.   ERRCODE_NOSERVERSW            = 106;    { 0x6a Server software not running the workstation/server }
  3397.  
  3398.  
  3399.   DBIERR_OSEINVFNC              = ( ERRBASE_OS + ERRCODE_OSEINVFNC );
  3400.   DBIERR_OSENOENT               = ( ERRBASE_OS + ERRCODE_OSENOENT );
  3401.   DBIERR_OSENOPATH              = ( ERRBASE_OS + ERRCODE_OSENOPATH );
  3402.   DBIERR_OSEMFILE               = ( ERRBASE_OS + ERRCODE_OSEMFILE );
  3403.   DBIERR_OSEACCES               = ( ERRBASE_OS + ERRCODE_OSEACCES );
  3404.   DBIERR_OSEBADF                = ( ERRBASE_OS + ERRCODE_OSEBADF );
  3405.   DBIERR_OSECONTR               = ( ERRBASE_OS + ERRCODE_OSECONTR );
  3406.   DBIERR_OSENOMEM               = ( ERRBASE_OS + ERRCODE_OSENOMEM );
  3407.   DBIERR_OSEINVMEM              = ( ERRBASE_OS + ERRCODE_OSEINVMEM );
  3408.   DBIERR_OSEINVENV              = ( ERRBASE_OS + ERRCODE_OSEINVENV );
  3409.   DBIERR_OSEINVFMT              = ( ERRBASE_OS + ERRCODE_OSEINVFMT );
  3410.   DBIERR_OSEINVACC              = ( ERRBASE_OS + ERRCODE_OSEINVACC );
  3411.   DBIERR_OSEINVDAT              = ( ERRBASE_OS + ERRCODE_OSEINVDAT );
  3412.   DBIERR_OSENODEV               = ( ERRBASE_OS + ERRCODE_OSENODEV );
  3413.   DBIERR_OSECURDIR              = ( ERRBASE_OS + ERRCODE_OSECURDIR );
  3414.   DBIERR_OSENOTSAM              = ( ERRBASE_OS + ERRCODE_OSENOTSAM );
  3415.   DBIERR_OSENMFILE              = ( ERRBASE_OS + ERRCODE_OSENMFILE );
  3416.   DBIERR_OSEINVAL               = ( ERRBASE_OS + ERRCODE_OSEINVAL );
  3417.   DBIERR_OSE2BIG                = ( ERRBASE_OS + ERRCODE_OSE2BIG );
  3418.   DBIERR_OSENOEXEC              = ( ERRBASE_OS + ERRCODE_OSENOEXEC );
  3419.   DBIERR_OSEXDEV                = ( ERRBASE_OS + ERRCODE_OSEXDEV );
  3420.   DBIERR_OSEDOM                 = ( ERRBASE_OS + ERRCODE_OSEDOM );
  3421.   DBIERR_OSERANGE               = ( ERRBASE_OS + ERRCODE_OSERANGE );
  3422.   DBIERR_OSEEXIST               = ( ERRBASE_OS + ERRCODE_OSEEXIST );
  3423.   DBIERR_OSUNKNOWN              = ( ERRBASE_OS + ERRCODE_OSUNKNOWN );
  3424.   DBIERR_OSSHAREVIOL            = ( ERRBASE_OS + ERRCODE_OSSHAREVIOL );
  3425.   DBIERR_OSLOCKVIOL             = ( ERRBASE_OS + ERRCODE_OSLOCKVIOL );
  3426.   DBIERR_OSNETERR               = ( ERRBASE_OS + ERRCODE_OSNETERR );
  3427.   DBIERR_OSINT24FAIL            = ( ERRBASE_OS + ERRCODE_OSINT24FAIL );
  3428.   DBIERR_OSDRIVENOTREADY        = ( ERRBASE_OS + ERRCODE_OSDRIVENOTREADY );
  3429.  
  3430.  
  3431.   DBIERR_NOTEXACT               = ( ERRBASE_OS + ERRCODE_NOTEXACT );
  3432.   DBIERR_OSUNKNOWNSRVERR        = ( ERRBASE_OS + ERRCODE_OSUNKNOWNSRVERR );
  3433.   DBIERR_SERVERNOMEMORY         = ( ERRBASE_OS + ERRCODE_SERVERNOMEMORY );
  3434.   DBIERR_OSALREADYLOCKED        = ( ERRBASE_OS + ERRCODE_OSALREADYLOCKED );
  3435.   DBIERR_OSNOTLOCKED            = ( ERRBASE_OS + ERRCODE_OSNOTLOCKED );
  3436.   DBIERR_NOSERVERSW             = ( ERRBASE_OS + ERRCODE_NOSERVERSW);
  3437.  
  3438. { ERRCAT_NETWORK }
  3439. { ============== }
  3440.  
  3441.   ERRCODE_NETINITERR            = 1;      { Net init failed }
  3442.   ERRCODE_NETUSERLIMIT          = 2;      { Net user limit exceeded }
  3443.   ERRCODE_NETFILEVERSION        = 3;      { Wrong net file version }
  3444.   ERRCODE_NETFILELOCKED         = 4;      { Not able to lock net file }
  3445.   ERRCODE_DIRNOTPRIVATE         = 5;
  3446.   ERRCODE_NETMULTIPLE           = 6;      { Multiple net files in use }
  3447.   ERRCODE_NETUNKNOWN            = 7;      { Unknown net error }
  3448.   ERRCODE_SHAREDFILE            = 8;      { Cannot access a shared file }
  3449.   ERRCODE_SHARENOTLOADED        = 9;      { Share not loaded }
  3450.   ERRCODE_NOTONANETWORK         = 10;     { 0x0a Not an Network }
  3451.   ERRCODE_SQLCOMMLOST           = 11;     { 0x0b Lost Communication with SQL server }
  3452.   ERRCODE_SERVERCOMMLOST        = 12;     { 0x0c Lost Communication with IDAPI server }
  3453.   ERRCODE_SQLSERVERNOTFOUND     = 13;     { 0x0d SQL Server not found }
  3454.   ERRCODE_SERVERNOTFOUND        = 14;     { 0x0e SQL Server not found }
  3455.  
  3456.   DBIERR_NETINITERR             = (ERRBASE_NETWORK + ERRCODE_NETINITERR);
  3457.   DBIERR_NETUSERLIMIT           = (ERRBASE_NETWORK + ERRCODE_NETUSERLIMIT);
  3458.   DBIERR_NETFILEVERSION         = (ERRBASE_NETWORK + ERRCODE_NETFILEVERSION);
  3459.   DBIERR_NETFILELOCKED          = (ERRBASE_NETWORK + ERRCODE_NETFILELOCKED);
  3460.   DBIERR_DIRNOTPRIVATE          = (ERRBASE_NETWORK + ERRCODE_DIRNOTPRIVATE);
  3461.   DBIERR_NETMULTIPLE            = (ERRBASE_NETWORK + ERRCODE_NETMULTIPLE);
  3462.   DBIERR_NETUNKNOWN             = (ERRBASE_NETWORK + ERRCODE_NETUNKNOWN);
  3463.   DBIERR_SHAREDFILE             = (ERRBASE_NETWORK + ERRCODE_SHAREDFILE);
  3464.   DBIERR_SHARENOTLOADED         = (ERRBASE_NETWORK + ERRCODE_SHARENOTLOADED);
  3465.   DBIERR_NOTONANETWORK          = (ERRBASE_NETWORK + ERRCODE_NOTONANETWORK);
  3466.   DBIERR_SQLCOMMLOST            = (ERRBASE_NETWORK + ERRCODE_SQLCOMMLOST);
  3467.   DBIERR_SERVERCOMMLOST         = (ERRBASE_NETWORK + ERRCODE_SERVERCOMMLOST);
  3468.   DBIERR_SQLSERVERNOTFOUND      = (ERRBASE_NETWORK + ERRCODE_SQLSERVERNOTFOUND);
  3469.   DBIERR_SERVERNOTFOUND         = (ERRBASE_NETWORK + ERRCODE_SERVERNOTFOUND);
  3470.  
  3471. { ERRCAT_DRIVER }
  3472. { ============= }
  3473.  
  3474.   ERRCODE_WRONGDRVNAME          = 1;      { Wrong driver name }
  3475.   ERRCODE_WRONGSYSVER           = 2;      { Wrong system version }
  3476.   ERRCODE_WRONGDRVVER           = 3;      { Wrong driver version }
  3477.   ERRCODE_WRONGDRVTYPE          = 4;      { Wrong driver type }
  3478.   ERRCODE_CANNOTLOADDRV         = 5;      { Can not load driver }
  3479.   ERRCODE_CANNOTLOADLDDRV       = 6;      { Can not load language driver }
  3480.   ERRCODE_VENDINITFAIL          = 7;      { Vendor init failure }
  3481.   ERRCODE_DRIVERRESTRICTED      = 8;      { Client not enabled for this driver }
  3482.  
  3483.  
  3484.   DBIERR_WRONGDRVNAME           = (ERRBASE_DRIVER + ERRCODE_WRONGDRVNAME);
  3485.   DBIERR_WRONGSYSVER            = (ERRBASE_DRIVER + ERRCODE_WRONGSYSVER);
  3486.   DBIERR_WRONGDRVVER            = (ERRBASE_DRIVER + ERRCODE_WRONGDRVVER);
  3487.   DBIERR_WRONGDRVTYPE           = (ERRBASE_DRIVER + ERRCODE_WRONGDRVTYPE);
  3488.   DBIERR_CANNOTLOADDRV          = (ERRBASE_DRIVER + ERRCODE_CANNOTLOADDRV);
  3489.   DBIERR_CANNOTLOADLDDRV        = (ERRBASE_DRIVER + ERRCODE_CANNOTLOADLDDRV);
  3490.   DBIERR_VENDINITFAIL           = (ERRBASE_DRIVER + ERRCODE_VENDINITFAIL);
  3491.   DBIERR_DRIVERRESTRICTED       = (ERRBASE_DRIVER + ERRCODE_DRIVERRESTRICTED);
  3492.  
  3493.  
  3494. { ERRCAT_QUERY }
  3495. { ============ }
  3496.  
  3497.  
  3498.  
  3499.   DBICODE_AMBJOASY              = 1;      { obsolete }
  3500.   DBICODE_AMBJOSYM              = 2;      { obsolete }
  3501.   DBICODE_AMBOUTEX              = 3;
  3502.   DBICODE_AMBOUTPR              = 4;      { obsolete }
  3503.   DBICODE_AMBSYMAS              = 5;      { obsolete }
  3504.   DBICODE_ASETOPER              = 6;
  3505.   DBICODE_AVENUMDA              = 7;
  3506.   DBICODE_BADEXPR1              = 8;
  3507.   DBICODE_BADFLDOR              = 9;
  3508.   DBICODE_BADVNAME              = 10;     { 0x0a }
  3509.   DBICODE_BITMAPER              = 11;     { 0x0b }
  3510.   DBICODE_CALCBADR              = 12;     { 0x0c }
  3511.   DBICODE_CALCTYPE              = 13;     { 0x0d }
  3512.   DBICODE_CHGTO1TI              = 14;     { 0x0e }
  3513.   DBICODE_CHGTOCHG              = 15;     { 0x0f }
  3514.   DBICODE_CHGTOEXP              = 16;     { 0x10 }
  3515.   DBICODE_CHGTOINS              = 17;     { 0x11 }
  3516.   DBICODE_CHGTONEW              = 18;     { 0x12 }
  3517.   DBICODE_CHGTOVAL              = 19;     { 0x13 }
  3518.   DBICODE_CHKMRKFI              = 20;     { 0x14 }
  3519.   DBICODE_CHNAMBIG              = 21;     { 0x15 }
  3520.   DBICODE_CHUNKERR              = 22;     { 0x16 }
  3521.   DBICODE_COLUM255              = 23;     { 0x17 }
  3522.   DBICODE_CONAFTAS              = 24;     { 0x18 }
  3523.   DBICODE_DEL1TIME              = 25;     { 0x19 }
  3524.   DBICODE_DELAMBIG              = 26;     { 0x1a }
  3525.   DBICODE_DELFRDEL              = 27;     { 0x1b }
  3526.   DBICODE_EGFLDTYP              = 28;     { 0x1c }
  3527.   DBICODE_EXAMINOR              = 29;     { 0x1d }
  3528.   DBICODE_EXPRTYPS              = 30;     { 0x1e }
  3529.   DBICODE_EXTRACOM              = 31;     { 0x1f }
  3530.   DBICODE_EXTRAORO              = 32;     { 0x20 }
  3531.   DBICODE_EXTRAQRO              = 33;     { 0x21 }
  3532.   DBICODE_FIND1ATT              = 34;     { 0x22 }
  3533.   DBICODE_FINDANST              = 35;     { 0x23 }
  3534.   DBICODE_GRPNOSET              = 36;     { 0x24 }
  3535.   DBICODE_GRPSTROW              = 37;     { 0x25 }
  3536.   DBICODE_IDFINLCO              = 38;     { 0x26 }
  3537.   DBICODE_IDFPERLI              = 39;     { 0x27 }
  3538.   DBICODE_INANEXPR              = 40;     { 0x28 }
  3539.   DBICODE_INS1TIME              = 41;     { 0x29 }
  3540.   DBICODE_INSAMBIG              = 42;     { 0x2a }
  3541.   DBICODE_INSDELCH              = 43;     { 0x2b }
  3542.   DBICODE_INSEXPRR              = 44;     { 0x2c }
  3543.   DBICODE_INSTOINS              = 45;     { 0x2d }
  3544.   DBICODE_ISARRAY               = 46;     { 0x2e }
  3545.   DBICODE_LABELERR              = 47;     { 0x2f }
  3546.   DBICODE_LINKCALC              = 48;     { 0x30 }
  3547.   DBICODE_LNGVNAME              = 49;     { 0x31 }
  3548.   DBICODE_LONGQURY              = 50;     { 0x32 }
  3549.   DBICODE_MEMVPROC              = 51;     { 0x33 }
  3550.   DBICODE_MISNGCOM              = 52;     { 0x34 }
  3551.   DBICODE_MISNGRPA              = 53;     { 0x35 }
  3552.   DBICODE_MISSRTQU              = 54;     { 0x36 }
  3553.   DBICODE_NAMTWICE              = 55;     { 0x37 }
  3554.   DBICODE_NOCHKMAR              = 56;     { 0x38 }
  3555.   DBICODE_NODEFOCC              = 57;     { 0x39 }
  3556.   DBICODE_NOGROUPS              = 58;     { 0x3a }
  3557.   DBICODE_NONSENSE              = 59;     { 0x3b }
  3558.   DBICODE_NOPATTER              = 60;     { 0x3c }
  3559.   DBICODE_NOSUCHDA              = 61;     { 0x3d }
  3560.   DBICODE_NOVALUE               = 62;     { 0x3e }
  3561.   DBICODE_ONLYCONS              = 63;     { 0x3f }
  3562.   DBICODE_ONLYSETR              = 64;     { 0x40 }
  3563.   DBICODE_OUTSENS1              = 65;     { 0x41 }
  3564.   DBICODE_OUTTWIC1              = 66;     { 0x42 }
  3565.   DBICODE_PAROWCNT              = 67;     { 0x43 }
  3566.   DBICODE_PERSEPAR              = 68;     { 0x44 }
  3567.   DBICODE_PROCPLSW              = 69;     { 0x45 }
  3568.   DBICODE_PWINSRTS              = 70;     { 0x46 }
  3569.   DBICODE_PWMODRTS              = 71;     { 0x47 }
  3570.   DBICODE_QBEFLDFOUND           = 72;     { 0x48 }
  3571.   DBICODE_QBENOFENCE            = 73;     { 0x49 }
  3572.   DBICODE_QBENOFENCET           = 74;     { 0x4a }
  3573.   DBICODE_QBENOHEADERT          = 75;     { 0x4b }
  3574.   DBICODE_QBENOTAB              = 76;     { 0x4c }
  3575.   DBICODE_QBENUMCOLS            = 77;     { 0x4d }
  3576.   DBICODE_QBEOPENTAB            = 78;     { 0x4e }
  3577.   DBICODE_QBETWICE              = 79;     { 0x4f }
  3578.   DBICODE_QRYNOANSWER           = 80;     { 0x50 }
  3579.   DBICODE_QRYNOTPREP            = 81;     { 0x51 }
  3580.   DBICODE_QUAINDEL              = 82;     { 0x52 }
  3581.   DBICODE_QUAININS              = 83;     { 0x53 }
  3582.   DBICODE_RAGININS              = 84;     { 0x54 }
  3583.   DBICODE_RAGINSET              = 85;     { 0x55 }
  3584.   DBICODE_ROWUSERR              = 86;     { 0x56 }
  3585.   DBICODE_SETEXPEC              = 87;     { 0x57 }
  3586.   DBICODE_SETVAMB1              = 88;     { 0x58 }
  3587.   DBICODE_SETVBAD1              = 89;     { 0x59 }
  3588.   DBICODE_SETVDEF1              = 90;     { 0x5a }
  3589.   DBICODE_SUMNUMBE              = 91;     { 0x5b }
  3590.   DBICODE_TBLISWP3              = 92;     { 0x5c }
  3591.   DBICODE_TOKENNOT              = 93;     { 0x5d }
  3592.   DBICODE_TWOOUTR1              = 94;     { 0x5e }
  3593.   DBICODE_TYPEMISM              = 95;     { 0x5f }
  3594.   DBICODE_UNRELQ1               = 96;     { 0x60 }
  3595.   DBICODE_UNUSEDST              = 97;     { 0x61 }
  3596.   DBICODE_USEINSDE              = 98;     { 0x62 }
  3597.   DBICODE_USEOFCHG              = 99;     { 0x63 }
  3598.   DBICODE_VARMUSTF              = 100;    { 0x64 }
  3599.   DBICODE_REGISTER              = 101;    { 0x65 }
  3600.   DBICODE_LONGEXPR              = 102;    { 0x66 }
  3601.   DBICODE_REFRESH               = 103;    { 0x67 }
  3602.   DBICODE_CANCEXCEPT            = 104;    { 0x68 }
  3603.   DBICODE_DBEXCEPT              = 105;    { 0x69 }
  3604.   DBICODE_MEMEXCEPT             = 106;    { 0x6a }
  3605.   DBICODE_FATALEXCEPT           = 107;    { 0x6b }
  3606.   DBICODE_QRYNIY                = 108;    { 0x6c }
  3607.   DBICODE_BADFORMAT             = 109;    { 0x6d }
  3608.   DBICODE_QRYEMPTY              = 110;    { 0x6e }
  3609.   DBICODE_NOQRYTOPREP           = 111;    { 0x6f }
  3610.   DBICODE_BUFFTOOSMALL          = 112;    { 0x70 }
  3611.   DBICODE_QRYNOTPARSE           = 113;    { 0x71 }
  3612.   DBICODE_NOTHANDLE             = 114;    { 0x72 }
  3613.   DBICODE_QRYSYNTERR            = 115;    { 0x73 }
  3614.   DBICODE_QXFLDCOUNT            = 116;    { 0x74 }
  3615.   DBICODE_QXFLDSYMNOTFOUND      = 117;    { 0x75 }
  3616.   DBICODE_QXTBLSYMNOTFOUND      = 118;    { 0x76 }
  3617.   DBICODE_BLOBTERM              = 119;    { 0x77 }
  3618.   DBICODE_BLOBERR               = 120;    { 0x78 }
  3619.   DBICODE_RESTARTQRY            = 121;    { 0x79 }
  3620.   DBICODE_UNKNOWNANSTYPE        = 122;    { 0x7a }
  3621.  
  3622. { Internal QBE use Only. }
  3623.   DBICODE_SQLG_MDIST            = 123;    { 0x7b }
  3624.   DBICODE_SQLG_NOARI            = 124;    { 0x7c }
  3625.   DBICODE_SQLG_LIKEN            = 125;    { 0x7d }
  3626.   DBICODE_SQLG_ALPHO            = 126;    { 0x7e }
  3627.   DBICODE_SQLG_DATEO            = 127;    { 0x7f }
  3628.   DBICODE_SQLG_RELOP            = 128;    { 0x80 }
  3629.   DBICODE_SQLG_ONLYC            = 129;    { 0x81 }
  3630.   DBICODE_SQLG_CNTLN            = 130;    { 0x82 }
  3631.   DBICODE_SQLG_CHINI            = 131;    { 0x83 }
  3632.   DBICODE_SQLG_UNION            = 132;    { 0x84 }
  3633.   DBICODE_SQLG_SLFIN            = 133;    { 0x85 }
  3634.   DBICODE_SQLG_OTJVR            = 134;    { 0x86 }
  3635.   DBICODE_SQLG_STROW            = 135;    { 0x87 }
  3636.   DBICODE_SQLG_QUANT            = 136;    { 0x88 }
  3637.   DBICODE_SQLG_REGSO            = 137;    { 0x89 }
  3638.   DBICODE_SQLG_COUNT            = 138;    { 0x8a }
  3639.   DBICODE_SQLG_AVERA            = 139;    { 0x8b }
  3640.   DBICODE_SQLG_DATEA            = 140;    { 0x8c }
  3641.   DBICODE_SQLG_BADPT            = 141;    { 0x8d }
  3642.   DBICODE_SQLG_RELPA            = 142;    { 0x8e }
  3643.   DBICODE_SQLG_PATRN            = 143;    { 0x8f }
  3644.   DBICODE_SQLG_FNDSU            = 144;    { 0x90 }
  3645.   DBICODE_SQLG_IFDCS            = 145;    { 0x91 }
  3646.   DBICODE_SQLG_IDCCO            = 146;    { 0x92 }
  3647.   DBICODE_SQLG_ONLYI            = 147;    { 0x93 }
  3648.   DBICODE_SQLG_SQLDIALECT       = 148;    { 0x94 }
  3649.   DBICODE_SQLG_NOQUERY          = 149;    { 0x95 }
  3650. { End of Internal.       }
  3651.  
  3652.   DBICODE_BLOBGROUP             = 150;    { 0x96 }
  3653.   DBICODE_QRYNOPROP             = 151;    { 0x97 }
  3654.   DBICODE_ANSTYPNOTSUP          = 152;    { 0x98 }
  3655.   DBICODE_ANSALIASNOTSUP        = 153;    { 0x99 }
  3656.   DBICODE_INSBLOBREQ            = 154;    { 0x9a }
  3657.   DBICODE_CHGUNIQUENDXREQ       = 155;    { 0x9b }
  3658.   DBICODE_DELUNIQUENDXREQ       = 156;    { 0x9c }
  3659.   DBICODE_SQLNOFULLUPDATE       = 157;    { 0x9d }
  3660.   DBICODE_CANTEXECREMOTE        = 158;    { 0x9e }
  3661.   DBICODE_UNEXPECTEDEOC         = 159;    { 0x9f }
  3662.   DBICODE_SQLPARAMNOTSET        = 160;    { 0xA0 }
  3663.   DBICODE_QUERYTOOLONG          = 161;    { 0xA1 }
  3664.  
  3665. { Errors added for localsql }
  3666.   DBICODE_NOSUCHRELORALIAS      = 170;
  3667.   DBICODE_TYPEAMBIGUITY         = 171;
  3668.   DBICODE_ORDERBYNOTAPROJ       = 172;
  3669.   DBICODE_SQLPARSE              = 173;
  3670.   DBICODE_CONSTRAINTFAILED      = 174;
  3671.   DBICODE_NOTGROUPINGFIELD      = 175;
  3672.   DBICODE_UDFNOTDEFINED         = 176;
  3673.   DBICODE_UDFERROR              = 177;
  3674.   DBICODE_SINGLEROWERROR        = 178;
  3675.   DBICODE_GROUPEXPR             = 179;
  3676.   DBICODE_QUERYTEXT             = 180;
  3677.   DBICODE_ANSIJOINSUP           = 181;
  3678.   DBICODE_DISTUNION             = 182;
  3679.   DBICODE_GROUPBYREQ            = 183;
  3680.   DBICODE_INSUPDAUTOIC          = 184;
  3681.   DBICODE_UPDREFINTSINGLE       = 185;
  3682.   DBICODE_NOMSACCESS            = 186;
  3683.   DBICODE_FIELDCONSTPREP        = 187;
  3684.   DBICODE_FIELDDEFPREP          = 188;
  3685.   DBICODE_RECCONSTPREP          = 189;
  3686.  
  3687.   DBICODE_TOOFEWSUBEXPR         = 190;    { 0xBE }
  3688.   DBICODE_TOOMANYSUBEXPR        = 191;    { 0xBF }
  3689.   DBICODE_INVALIDNODETYPE       = 192;    { 0xC0 }
  3690.   DBICODE_BOOLEXPR              = 193;    { 0xC1 }
  3691.   DBICODE_NONBOOLEXPR           = 194;    { 0xC2 }
  3692.   DBICODE_NOOUTERJOIN           = 195;    { 0xC3 }
  3693.   DBICODE_USERCONSTRERR         = 196;    { 0xC4 }
  3694.  
  3695.  
  3696.   DBIERR_AMBJOASY               = (ERRBASE_QUERY+DBICODE_AMBJOASY);
  3697.   DBIERR_AMBJOSYM               = (ERRBASE_QUERY+DBICODE_AMBJOSYM);
  3698.   DBIERR_AMBOUTEX               = (ERRBASE_QUERY+DBICODE_AMBOUTEX);
  3699.   DBIERR_AMBOUTPR               = (ERRBASE_QUERY+DBICODE_AMBOUTPR);
  3700.   DBIERR_AMBSYMAS               = (ERRBASE_QUERY+DBICODE_AMBSYMAS);
  3701.   DBIERR_ASETOPER               = (ERRBASE_QUERY+DBICODE_ASETOPER);
  3702.   DBIERR_AVENUMDA               = (ERRBASE_QUERY+DBICODE_AVENUMDA);
  3703.   DBIERR_BADEXPR1               = (ERRBASE_QUERY+DBICODE_BADEXPR1);
  3704.   DBIERR_BADFLDOR               = (ERRBASE_QUERY+DBICODE_BADFLDOR);
  3705.   DBIERR_BADVNAME               = (ERRBASE_QUERY+DBICODE_BADVNAME);
  3706.   DBIERR_BITMAPER               = (ERRBASE_QUERY+DBICODE_BITMAPER);
  3707.   DBIERR_CALCBADR               = (ERRBASE_QUERY+DBICODE_CALCBADR);
  3708.   DBIERR_CALCTYPE               = (ERRBASE_QUERY+DBICODE_CALCTYPE);
  3709.   DBIERR_CHGTO1TI               = (ERRBASE_QUERY+DBICODE_CHGTO1TI);
  3710.   DBIERR_CHGTOCHG               = (ERRBASE_QUERY+DBICODE_CHGTOCHG);
  3711.   DBIERR_CHGTOEXP               = (ERRBASE_QUERY+DBICODE_CHGTOEXP);
  3712.   DBIERR_CHGTOINS               = (ERRBASE_QUERY+DBICODE_CHGTOINS);
  3713.   DBIERR_CHGTONEW               = (ERRBASE_QUERY+DBICODE_CHGTONEW);
  3714.   DBIERR_CHGTOVAL               = (ERRBASE_QUERY+DBICODE_CHGTOVAL);
  3715.   DBIERR_CHKMRKFI               = (ERRBASE_QUERY+DBICODE_CHKMRKFI);
  3716.   DBIERR_CHNAMBIG               = (ERRBASE_QUERY+DBICODE_CHNAMBIG);
  3717.   DBIERR_CHUNKERR               = (ERRBASE_QUERY+DBICODE_CHUNKERR);
  3718.   DBIERR_COLUM255               = (ERRBASE_QUERY+DBICODE_COLUM255);
  3719.   DBIERR_CONAFTAS               = (ERRBASE_QUERY+DBICODE_CONAFTAS);
  3720.   DBIERR_DEL1TIME               = (ERRBASE_QUERY+DBICODE_DEL1TIME);
  3721.   DBIERR_DELAMBIG               = (ERRBASE_QUERY+DBICODE_DELAMBIG);
  3722.   DBIERR_DELFRDEL               = (ERRBASE_QUERY+DBICODE_DELFRDEL);
  3723.   DBIERR_EGFLDTYP               = (ERRBASE_QUERY+DBICODE_EGFLDTYP);
  3724.   DBIERR_EXAMINOR               = (ERRBASE_QUERY+DBICODE_EXAMINOR);
  3725.   DBIERR_EXPRTYPS               = (ERRBASE_QUERY+DBICODE_EXPRTYPS);
  3726.   DBIERR_EXTRACOM               = (ERRBASE_QUERY+DBICODE_EXTRACOM);
  3727.   DBIERR_EXTRAORO               = (ERRBASE_QUERY+DBICODE_EXTRAORO);
  3728.   DBIERR_EXTRAQRO               = (ERRBASE_QUERY+DBICODE_EXTRAQRO);
  3729.   DBIERR_FIND1ATT               = (ERRBASE_QUERY+DBICODE_FIND1ATT);
  3730.   DBIERR_FINDANST               = (ERRBASE_QUERY+DBICODE_FINDANST);
  3731.   DBIERR_GRPNOSET               = (ERRBASE_QUERY+DBICODE_GRPNOSET);
  3732.   DBIERR_GRPSTROW               = (ERRBASE_QUERY+DBICODE_GRPSTROW);
  3733.   DBIERR_IDFINLCO               = (ERRBASE_QUERY+DBICODE_IDFINLCO);
  3734.   DBIERR_IDFPERLI               = (ERRBASE_QUERY+DBICODE_IDFPERLI);
  3735.   DBIERR_INANEXPR               = (ERRBASE_QUERY+DBICODE_INANEXPR);
  3736.   DBIERR_INS1TIME               = (ERRBASE_QUERY+DBICODE_INS1TIME);
  3737.   DBIERR_INSAMBIG               = (ERRBASE_QUERY+DBICODE_INSAMBIG);
  3738.   DBIERR_INSDELCH               = (ERRBASE_QUERY+DBICODE_INSDELCH);
  3739.   DBIERR_INSEXPRR               = (ERRBASE_QUERY+DBICODE_INSEXPRR);
  3740.   DBIERR_INSTOINS               = (ERRBASE_QUERY+DBICODE_INSTOINS);
  3741.   DBIERR_ISARRAY                = (ERRBASE_QUERY+DBICODE_ISARRAY);
  3742.   DBIERR_LABELERR               = (ERRBASE_QUERY+DBICODE_LABELERR);
  3743.   DBIERR_LINKCALC               = (ERRBASE_QUERY+DBICODE_LINKCALC);
  3744.   DBIERR_LNGVNAME               = (ERRBASE_QUERY+DBICODE_LNGVNAME);
  3745.   DBIERR_LONGQURY               = (ERRBASE_QUERY+DBICODE_LONGQURY);
  3746.   DBIERR_MEMVPROC               = (ERRBASE_QUERY+DBICODE_MEMVPROC);
  3747.   DBIERR_MISNGCOM               = (ERRBASE_QUERY+DBICODE_MISNGCOM);
  3748.   DBIERR_MISNGRPA               = (ERRBASE_QUERY+DBICODE_MISNGRPA);
  3749.   DBIERR_MISSRTQU               = (ERRBASE_QUERY+DBICODE_MISSRTQU);
  3750.   DBIERR_NAMTWICE               = (ERRBASE_QUERY+DBICODE_NAMTWICE);
  3751.   DBIERR_NOCHKMAR               = (ERRBASE_QUERY+DBICODE_NOCHKMAR);
  3752.   DBIERR_NODEFOCC               = (ERRBASE_QUERY+DBICODE_NODEFOCC);
  3753.   DBIERR_NOGROUPS               = (ERRBASE_QUERY+DBICODE_NOGROUPS);
  3754.   DBIERR_NONSENSE               = (ERRBASE_QUERY+DBICODE_NONSENSE);
  3755.   DBIERR_NOPATTER               = (ERRBASE_QUERY+DBICODE_NOPATTER);
  3756.   DBIERR_NOSUCHDA               = (ERRBASE_QUERY+DBICODE_NOSUCHDA);
  3757.   DBIERR_NOVALUE                = (ERRBASE_QUERY+DBICODE_NOVALUE);
  3758.   DBIERR_ONLYCONS               = (ERRBASE_QUERY+DBICODE_ONLYCONS);
  3759.   DBIERR_ONLYSETR               = (ERRBASE_QUERY+DBICODE_ONLYSETR);
  3760.   DBIERR_OUTSENS1               = (ERRBASE_QUERY+DBICODE_OUTSENS1);
  3761.   DBIERR_OUTTWIC1               = (ERRBASE_QUERY+DBICODE_OUTTWIC1);
  3762.   DBIERR_PAROWCNT               = (ERRBASE_QUERY+DBICODE_PAROWCNT);
  3763.   DBIERR_PERSEPAR               = (ERRBASE_QUERY+DBICODE_PERSEPAR);
  3764.   DBIERR_PROCPLSW               = (ERRBASE_QUERY+DBICODE_PROCPLSW);
  3765.   DBIERR_PWINSRTS               = (ERRBASE_QUERY+DBICODE_PWINSRTS);
  3766.   DBIERR_PWMODRTS               = (ERRBASE_QUERY+DBICODE_PWMODRTS);
  3767.   DBIERR_QBEFLDFOUND            = (ERRBASE_QUERY+DBICODE_QBEFLDFOUND);
  3768.   DBIERR_QBENOFENCE             = (ERRBASE_QUERY+DBICODE_QBENOFENCE);
  3769.   DBIERR_QBENOFENCET            = (ERRBASE_QUERY+DBICODE_QBENOFENCET);
  3770.   DBIERR_QBENOHEADERT           = (ERRBASE_QUERY+DBICODE_QBENOHEADERT);
  3771.   DBIERR_QBENOTAB               = (ERRBASE_QUERY+DBICODE_QBENOTAB);
  3772.   DBIERR_QBENUMCOLS             = (ERRBASE_QUERY+DBICODE_QBENUMCOLS);
  3773.   DBIERR_QBEOPENTAB             = (ERRBASE_QUERY+DBICODE_QBEOPENTAB);
  3774.   DBIERR_QBETWICE               = (ERRBASE_QUERY+DBICODE_QBETWICE);
  3775.   DBIERR_QRYNOANSWER            = (ERRBASE_QUERY+DBICODE_QRYNOANSWER);
  3776.   DBIERR_QRYNOTPREP             = (ERRBASE_QUERY+DBICODE_QRYNOTPREP);
  3777.   DBIERR_QUAINDEL               = (ERRBASE_QUERY+DBICODE_QUAINDEL);
  3778.   DBIERR_QUAININS               = (ERRBASE_QUERY+DBICODE_QUAININS);
  3779.   DBIERR_RAGININS               = (ERRBASE_QUERY+DBICODE_RAGININS);
  3780.   DBIERR_RAGINSET               = (ERRBASE_QUERY+DBICODE_RAGINSET);
  3781.   DBIERR_ROWUSERR               = (ERRBASE_QUERY+DBICODE_ROWUSERR);
  3782.   DBIERR_SETEXPEC               = (ERRBASE_QUERY+DBICODE_SETEXPEC);
  3783.   DBIERR_SETVAMB1               = (ERRBASE_QUERY+DBICODE_SETVAMB1);
  3784.   DBIERR_SETVBAD1               = (ERRBASE_QUERY+DBICODE_SETVBAD1);
  3785.   DBIERR_SETVDEF1               = (ERRBASE_QUERY+DBICODE_SETVDEF1);
  3786.   DBIERR_SUMNUMBE               = (ERRBASE_QUERY+DBICODE_SUMNUMBE);
  3787.   DBIERR_TBLISWP3               = (ERRBASE_QUERY+DBICODE_TBLISWP3);
  3788.   DBIERR_TOKENNOT               = (ERRBASE_QUERY+DBICODE_TOKENNOT);
  3789.   DBIERR_TWOOUTR1               = (ERRBASE_QUERY+DBICODE_TWOOUTR1);
  3790.   DBIERR_TYPEMISM               = (ERRBASE_QUERY+DBICODE_TYPEMISM);
  3791.   DBIERR_UNRELQ1                = (ERRBASE_QUERY+DBICODE_UNRELQ1);
  3792.   DBIERR_UNUSEDST               = (ERRBASE_QUERY+DBICODE_UNUSEDST);
  3793.   DBIERR_USEINSDE               = (ERRBASE_QUERY+DBICODE_USEINSDE);
  3794.   DBIERR_USEOFCHG               = (ERRBASE_QUERY+DBICODE_USEOFCHG);
  3795.   DBIERR_VARMUSTF               = (ERRBASE_QUERY+DBICODE_VARMUSTF);
  3796.   DBIERR_REGISTER               = (ERRBASE_QUERY+DBICODE_REGISTER);
  3797.   DBIERR_LONGEXPR               = (ERRBASE_QUERY+DBICODE_LONGEXPR);
  3798.   DBIERR_REFRESH                = (ERRBASE_QUERY+DBICODE_REFRESH);
  3799.   DBIERR_CANCEXCEPT             = (ERRBASE_QUERY+DBICODE_CANCEXCEPT);
  3800.   DBIERR_DBEXCEPT               = (ERRBASE_QUERY+DBICODE_DBEXCEPT);
  3801.   DBIERR_MEMEXCEPT              = (ERRBASE_QUERY+DBICODE_MEMEXCEPT);
  3802.   DBIERR_FATALEXCEPT            = (ERRBASE_QUERY+DBICODE_FATALEXCEPT);
  3803.   DBIERR_QRYNIY                 = (ERRBASE_QUERY+ DBICODE_QRYNIY);
  3804.   DBIERR_BADFORMAT              = (ERRBASE_QUERY+ DBICODE_BADFORMAT);
  3805.   DBIERR_QRYEMPTY               = (ERRBASE_QUERY+ DBICODE_QRYEMPTY);
  3806.   DBIERR_NOQRYTOPREP            = (ERRBASE_QUERY+ DBICODE_NOQRYTOPREP);
  3807.   DBIERR_BUFFTOOSMALL           = (ERRBASE_QUERY+ DBICODE_BUFFTOOSMALL);
  3808.   DBIERR_QRYNOTPARSE            = (ERRBASE_QUERY+ DBICODE_QRYNOTPARSE);
  3809.   DBIERR_NOTHANDLE              = (ERRBASE_QUERY+ DBICODE_NOTHANDLE);
  3810.   DBIERR_QRYSYNTERR             = (ERRBASE_QUERY+ DBICODE_QRYSYNTERR);
  3811.   DBIERR_QXFLDCOUNT             = (ERRBASE_QUERY+ DBICODE_QXFLDCOUNT);
  3812.   DBIERR_QXFLDSYMNOTFOUND       = (ERRBASE_QUERY+ DBICODE_QXFLDSYMNOTFOUND);
  3813.   DBIERR_QXTBLSYMNOTFOUND       = (ERRBASE_QUERY+ DBICODE_QXTBLSYMNOTFOUND);
  3814.   DBIERR_BLOBTERM               = (ERRBASE_QUERY+ DBICODE_BLOBTERM);
  3815.   DBIERR_BLOBERR                = (ERRBASE_QUERY+ DBICODE_BLOBERR);
  3816.   DBIERR_RESTARTQRY             = (ERRBASE_QUERY+ DBICODE_RESTARTQRY);
  3817.   DBIERR_UNKNOWNANSTYPE         = (ERRBASE_QUERY+ DBICODE_UNKNOWNANSTYPE);
  3818.   DBIERR_SQLG_MDIST             = (ERRBASE_QUERY+ DBICODE_SQLG_MDIST);
  3819.   DBIERR_SQLG_NOARI             = (ERRBASE_QUERY+ DBICODE_SQLG_NOARI);
  3820.   DBIERR_SQLG_LIKEN             = (ERRBASE_QUERY+ DBICODE_SQLG_LIKEN);
  3821.   DBIERR_SQLG_ALPHO             = (ERRBASE_QUERY+ DBICODE_SQLG_ALPHO);
  3822.   DBIERR_SQLG_DATEO             = (ERRBASE_QUERY+ DBICODE_SQLG_DATEO);
  3823.   DBIERR_SQLG_RELOP             = (ERRBASE_QUERY+ DBICODE_SQLG_RELOP);
  3824.   DBIERR_SQLG_ONLYC             = (ERRBASE_QUERY+ DBICODE_SQLG_ONLYC);
  3825.   DBIERR_SQLG_CNTLN             = (ERRBASE_QUERY+ DBICODE_SQLG_CNTLN);
  3826.   DBIERR_SQLG_CHINI             = (ERRBASE_QUERY+ DBICODE_SQLG_CHINI);
  3827.   DBIERR_SQLG_UNION             = (ERRBASE_QUERY+ DBICODE_SQLG_UNION);
  3828.   DBIERR_SQLG_SLFIN             = (ERRBASE_QUERY+ DBICODE_SQLG_SLFIN);
  3829.   DBIERR_SQLG_OTJVR             = (ERRBASE_QUERY+ DBICODE_SQLG_OTJVR);
  3830.   DBIERR_SQLG_STROW             = (ERRBASE_QUERY+ DBICODE_SQLG_STROW);
  3831.   DBIERR_SQLG_QUANT             = (ERRBASE_QUERY+ DBICODE_SQLG_QUANT);
  3832.   DBIERR_SQLG_REGSO             = (ERRBASE_QUERY+ DBICODE_SQLG_REGSO);
  3833.   DBIERR_SQLG_COUNT             = (ERRBASE_QUERY+ DBICODE_SQLG_COUNT);
  3834.   DBIERR_SQLG_AVERA             = (ERRBASE_QUERY+ DBICODE_SQLG_AVERA);
  3835.   DBIERR_SQLG_DATEA             = (ERRBASE_QUERY+ DBICODE_SQLG_DATEA);
  3836.   DBIERR_SQLG_BADPT             = (ERRBASE_QUERY+ DBICODE_SQLG_BADPT);
  3837.   DBIERR_SQLG_RELPA             = (ERRBASE_QUERY+ DBICODE_SQLG_RELPA);
  3838.   DBIERR_SQLG_PATRN             = (ERRBASE_QUERY+ DBICODE_SQLG_PATRN);
  3839.   DBIERR_SQLG_FNDSU             = (ERRBASE_QUERY+ DBICODE_SQLG_FNDSU);
  3840.   DBIERR_SQLG_IFDCS             = (ERRBASE_QUERY+ DBICODE_SQLG_IFDCS);
  3841.   DBIERR_SQLG_IDCCO             = (ERRBASE_QUERY+ DBICODE_SQLG_IDCCO);
  3842.   DBIERR_SQLG_ONLYI             = (ERRBASE_QUERY+ DBICODE_SQLG_ONLYI);
  3843.   DBIERR_SQLG_SQLDIALECT        = (ERRBASE_QUERY+ DBICODE_SQLG_SQLDIALECT);
  3844.   DBIERR_SQLG_NOQUERY           = (ERRBASE_QUERY+ DBICODE_SQLG_NOQUERY);
  3845.   DBIERR_BLOBGROUP              = (ERRBASE_QUERY+ DBICODE_BLOBGROUP);
  3846.   DBIERR_QRYNOPROP              = (ERRBASE_QUERY+DBICODE_QRYNOPROP);
  3847.   DBIERR_ANSTYPNOTSUP           = (ERRBASE_QUERY+DBICODE_ANSTYPNOTSUP);
  3848.   DBIERR_ANSALIASNOTSUP         = (ERRBASE_QUERY+DBICODE_ANSALIASNOTSUP);
  3849.   DBIERR_INSBLOBREQ             = (ERRBASE_QUERY+DBICODE_INSBLOBREQ     ); { 0x9a }
  3850.   DBIERR_CHGUNIQUENDXREQ        = (ERRBASE_QUERY+DBICODE_CHGUNIQUENDXREQ); { 0x9b }
  3851.   DBIERR_DELUNIQUENDXREQ        = (ERRBASE_QUERY+DBICODE_DELUNIQUENDXREQ); { 0x9c }
  3852.   DBIERR_SQLNOFULLUPDATE        = (ERRBASE_QUERY+DBICODE_SQLNOFULLUPDATE); { 0x9d }
  3853.   DBIERR_CANTEXECREMOTE         = (ERRBASE_QUERY+DBICODE_CANTEXECREMOTE); { 0x9e }
  3854.   DBIERR_UNEXPECTEDEOC          = (ERRBASE_QUERY+DBICODE_UNEXPECTEDEOC);
  3855.   DBIERR_SQLPARAMNOTSET         = (ERRBASE_QUERY+DBICODE_SQLPARAMNOTSET);
  3856.   DBIERR_QUERYTOOLONG           = (ERRBASE_QUERY+DBICODE_QUERYTOOLONG);
  3857.  
  3858.   DBIERR_NOSUCHRELORALIAS       = (ERRBASE_QUERY+DBICODE_NOSUCHRELORALIAS);
  3859.   DBIERR_TYPEAMBIGUITY          = (ERRBASE_QUERY+DBICODE_TYPEAMBIGUITY);
  3860.   DBIERR_ORDERBYNOTAPROJ        = (ERRBASE_QUERY+DBICODE_ORDERBYNOTAPROJ);
  3861.   DBIERR_SQLPARSE               = (ERRBASE_QUERY+DBICODE_SQLPARSE);
  3862.   DBIERR_CONSTRAINTFAILED       = (ERRBASE_QUERY+DBICODE_CONSTRAINTFAILED);
  3863.   DBIERR_NOTGROUPINGFIELD       = (ERRBASE_QUERY+DBICODE_NOTGROUPINGFIELD);
  3864.   DBIERR_UDFNOTDEFINED          = (ERRBASE_QUERY+DBICODE_UDFNOTDEFINED);
  3865.   DBIERR_UDFERROR               = (ERRBASE_QUERY+DBICODE_UDFERROR);
  3866.   DBIERR_SINGLEROWERROR         = (ERRBASE_QUERY+DBICODE_SINGLEROWERROR);
  3867.   DBIERR_GROUPEXPR              = (ERRBASE_QUERY+DBICODE_GROUPEXPR);
  3868.   DBIERR_QUERYTEXT              = (ERRBASE_QUERY+DBICODE_QUERYTEXT);
  3869.   DBIERR_ANSIJOINSUP            = (ERRBASE_QUERY+DBICODE_ANSIJOINSUP);
  3870.   DBIERR_DISTUNION              = (ERRBASE_QUERY+DBICODE_DISTUNION);
  3871.   DBIERR_GROUPBYREQ             = (ERRBASE_QUERY+DBICODE_GROUPBYREQ);
  3872.   DBIERR_INSUPDAUTOINC          = (ERRBASE_QUERY+DBICODE_INSUPDAUTOIC);
  3873.   DBIERR_UPDREFINTSINGLE        = (ERRBASE_QUERY+DBICODE_UPDREFINTSINGLE);
  3874.   DBIERR_NOMSACCESS             = (ERRBASE_QUERY+DBICODE_NOMSACCESS);
  3875.   DBIERR_FIELDCONSTPREP         = (ERRBASE_QUERY+DBICODE_FIELDCONSTPREP);
  3876.   DBIERR_FIELDDEFPREP           = (ERRBASE_QUERY+DBICODE_FIELDDEFPREP);
  3877.   DBIERR_RECCONSTPREP           = (ERRBASE_QUERY+DBICODE_RECCONSTPREP);
  3878.  
  3879.   DBIERR_TOOFEWSUBEXPR          = (ERRBASE_QUERY+DBICODE_TOOFEWSUBEXPR);
  3880.   DBIERR_TOOMANYSUBEXPR         = (ERRBASE_QUERY+DBICODE_TOOMANYSUBEXPR);
  3881.   DBIERR_INVALIDNODETYPE        = (ERRBASE_QUERY+DBICODE_INVALIDNODETYPE);
  3882.   DBIERR_BOOLEXPR               = (ERRBASE_QUERY+DBICODE_BOOLEXPR);
  3883.   DBIERR_NONBOOLEXPR            = (ERRBASE_QUERY+DBICODE_NONBOOLEXPR);
  3884.   DBIERR_NOOUTERJOIN            = (ERRBASE_QUERY+DBICODE_NOOUTERJOIN);
  3885.   DBIERR_USERCONSTRERR          = (ERRBASE_QUERY+DBICODE_USERCONSTRERR);
  3886.  
  3887. { END_OF_QUERY_MESSAGES }
  3888.  
  3889. { ERRCAT_VERSION }
  3890. { ============== }
  3891.  
  3892.   ERRCODE_INTERFACEVER          = 1;      { Interface mismatch }
  3893.   ERRCODE_INDEXOUTOFDATE        = 2;      { Index is out of date }
  3894.   ERRCODE_OLDVERSION            = 3;      { Older version (see context) }
  3895.   ERRCODE_VALFILEINVALID        = 4;      { Val. file is out of date }
  3896.   ERRCODE_BLOBVERSION           = 5;      { Old Blob file version }
  3897.   ERRCODE_ENGQRYMISMATCH        = 6;      { Query and IDAPI are mismatched }
  3898.   ERRCODE_SERVERVERSION         = 7;      { Server is incompatible version }
  3899.   ERRCODE_TABLELEVEL            = 8;      { Higher table level required }
  3900.  
  3901.   DBIERR_INTERFACEVER           = (ERRBASE_VERSION + ERRCODE_INTERFACEVER);
  3902.   DBIERR_INDEXOUTOFDATE         = (ERRBASE_VERSION + ERRCODE_INDEXOUTOFDATE);
  3903.   DBIERR_OLDVERSION             = (ERRBASE_VERSION + ERRCODE_OLDVERSION);
  3904.   DBIERR_VALFILEINVALID         = (ERRBASE_VERSION + ERRCODE_VALFILEINVALID);
  3905.   DBIERR_BLOBVERSION            = (ERRBASE_VERSION + ERRCODE_BLOBVERSION);
  3906.   DBIERR_ENGQRYMISMATCH         = (ERRBASE_VERSION + ERRCODE_ENGQRYMISMATCH);
  3907.   DBIERR_SERVERVERSION          = (ERRBASE_VERSION + ERRCODE_SERVERVERSION);
  3908.   DBIERR_TABLELEVEL             = (ERRBASE_VERSION + ERRCODE_TABLELEVEL);
  3909.  
  3910. { ERRCAT_CAPABILITY }
  3911. { ================= }
  3912.  
  3913.   ERRCODE_NOTSUPPORTED          = 1;      { Capability not supported }
  3914.   ERRCODE_NIY                   = 2;      { Not Implemented Yet }
  3915.   ERRCODE_TABLESQL              = 3;      { Cannot access SQL replica }
  3916.   ERRCODE_SEARCHCOLREQD         = 4;      { Searchable (Non-blob column) required }
  3917.   ERRCODE_NOMULTCONNECT         = 5;      { Multiple connections not supported }
  3918.   ERRCODE_NODBASEEXPR           = 6;      { Full dBASE Expressions not supported }
  3919.  
  3920.   DBIERR_NOTSUPPORTED           = (ERRBASE_CAPABILITY + ERRCODE_NOTSUPPORTED);
  3921.   DBIERR_NIY                    = (ERRBASE_CAPABILITY + ERRCODE_NIY);
  3922.   DBIERR_TABLESQL               = (ERRBASE_CAPABILITY + ERRCODE_TABLESQL);
  3923.   DBIERR_SEARCHCOLREQD          = (ERRBASE_CAPABILITY + ERRCODE_SEARCHCOLREQD);
  3924.   DBIERR_NOMULTCONNECT          = (ERRBASE_CAPABILITY + ERRCODE_NOMULTCONNECT);
  3925.   DBIERR_NODBASEEXPR            = (ERRBASE_CAPABILITY + ERRCODE_NODBASEEXPR);
  3926.  
  3927. { ERRCAT_CONFIG }
  3928. { ============= }
  3929.  
  3930.   ERRCODE_INVALIDDBSPEC         = 1;
  3931.   ERRCODE_UNKNOWNDBTYPE         = 2;
  3932.   ERRCODE_INVALIDSYSDATA        = 3;
  3933.   ERRCODE_UNKNOWNNETTYPE        = 4;
  3934.   ERRCODE_NOTONTHATNET          = 5;
  3935.   ERRCODE_INVALIDCFGPARAM       = 6;      { Generic invalid config param }
  3936.  
  3937.  
  3938.   DBIERR_INVALIDDBSPEC          = (ERRBASE_CONFIG + ERRCODE_INVALIDDBSPEC);
  3939.   DBIERR_UNKNOWNDBTYPE          = (ERRBASE_CONFIG + ERRCODE_UNKNOWNDBTYPE);
  3940.   DBIERR_INVALIDSYSDATA         = (ERRBASE_CONFIG + ERRCODE_INVALIDSYSDATA);
  3941.   DBIERR_UNKNOWNNETTYPE         = (ERRBASE_CONFIG + ERRCODE_UNKNOWNNETTYPE);
  3942.   DBIERR_NOTONTHATNET           = (ERRBASE_CONFIG + ERRCODE_NOTONTHATNET);
  3943.   DBIERR_INVALIDCFGPARAM        = (ERRBASE_CONFIG + ERRCODE_INVALIDCFGPARAM);
  3944.  
  3945. { ERRCAT_WARNING  non-fatal warnings:               }
  3946. { warn user of action, or ask for optional behavior }
  3947. { ================================================= }
  3948.   ERRCODE_OBJIMPLICITLYDROPPED  = 1;
  3949.   ERRCODE_OBJMAYBETRUNCATED     = 2;
  3950.   ERRCODE_OBJIMPLICITLYMODIFIED = 3;
  3951.   ERRCODE_VALIDATEDATA          = 4;
  3952.   ERRCODE_VALFIELDMODIFIED      = 5;
  3953.   ERRCODE_TABLELEVELCHANGED     = 6;
  3954.   ERRCODE_COPYLINKEDTABLES      = 7;
  3955.   ERRCODE_OTHERSERVERLOADED     = 8;
  3956.   ERRCODE_OBJIMPLICITLYTRUNCATED = 9;
  3957.   ERRCODE_VCHKMAYNOTBEENFORCED  = 10;
  3958.   ERRCODE_MULTIPLEUNIQRECS      = 11;
  3959.   ERRCODE_FIELDMUSTBETRIMMED    = 12;
  3960.  
  3961.   DBIERR_OBJIMPLICITLYDROPPED   = ( ERRBASE_WARNING + ERRCODE_OBJIMPLICITLYDROPPED);
  3962.   DBIERR_OBJMAYBETRUNCATED      = ( ERRBASE_WARNING + ERRCODE_OBJMAYBETRUNCATED);
  3963.   DBIERR_OBJIMPLICITLYMODIFIED  = ( ERRBASE_WARNING + ERRCODE_OBJIMPLICITLYMODIFIED);
  3964.   DBIERR_VALIDATEDATA           = ( ERRBASE_WARNING + ERRCODE_VALIDATEDATA);
  3965.   DBIERR_VALFIELDMODIFIED       = ( ERRBASE_WARNING + ERRCODE_VALFIELDMODIFIED);
  3966.   DBIERR_TABLELEVELCHANGED      = ( ERRBASE_WARNING + ERRCODE_TABLELEVELCHANGED);
  3967.   DBIERR_COPYLINKEDTABLES       = ( ERRBASE_WARNING + ERRCODE_COPYLINKEDTABLES);
  3968.   DBIERR_OTHERSERVERLOADED      = ( ERRBASE_WARNING + ERRCODE_OTHERSERVERLOADED);
  3969.   DBIERR_OBJIMPLICITLYTRUNCATED = ( ERRBASE_WARNING + ERRCODE_OBJIMPLICITLYTRUNCATED);
  3970.   DBIERR_VCHKMAYNOTBEENFORCED   = ( ERRBASE_WARNING + ERRCODE_VCHKMAYNOTBEENFORCED );
  3971.   DBIERR_MULTIPLEUNIQRECS       = ( ERRBASE_WARNING + ERRCODE_MULTIPLEUNIQRECS );
  3972.   DBIERR_FIELDMUSTBETRIMMED     = ( ERRBASE_WARNING + ERRCODE_FIELDMUSTBETRIMMED );
  3973.  
  3974.  
  3975. { ERRCAT_OTHER }
  3976. { ============ }
  3977.  
  3978.   ERRCODE_FILEEXISTS            = 1;      { File already exsits }
  3979.   ERRCODE_BLOBMODIFIED          = 2;      { Another user modified Blob }
  3980.   ERRCODE_UNKNOWNSQL            = 3;      { Unknown SQL error }
  3981.   ERRCODE_TABLEEXISTS           = 4;      { Table already exsits }
  3982.   ERRCODE_PDX10TABLE            = 5;      { Paradox 1.0 tables not supported }
  3983.   ERRCODE_UPDATEABORT           = 6;      { Update operation aborted }
  3984.  
  3985.  
  3986.   DBIERR_FILEEXISTS             = (ERRBASE_OTHER + ERRCODE_FILEEXISTS);
  3987.   DBIERR_BLOBMODIFIED           = (ERRBASE_OTHER + ERRCODE_BLOBMODIFIED);
  3988.   DBIERR_UNKNOWNSQL             = (ERRBASE_OTHER + ERRCODE_UNKNOWNSQL);
  3989.   DBIERR_TABLEEXISTS            = (ERRBASE_OTHER + ERRCODE_TABLEEXISTS);
  3990.   DBIERR_PDX10TABLE             = (ERRBASE_OTHER + ERRCODE_PDX10TABLE);
  3991.   DBIERR_UPDATEABORT            = (ERRBASE_OTHER + ERRCODE_UPDATEABORT);
  3992.  
  3993.  
  3994. { ERRCAT_COMPATIBILITY }
  3995. { ==================== }
  3996.  
  3997.   ERRCODE_DIFFSORTORDER         = 1;      { Sortorders not compatible }
  3998.   ERRCODE_DIRINUSEBYOLDVER      = 2;      { Directory in use by old version }
  3999.   ERRCODE_PDX35LDDRIVER         = 3;      { Needs Pdox 3.5 compatible language driver }
  4000.  
  4001.   DBIERR_DIFFSORTORDER          = (ERRBASE_COMPATIBILITY + ERRCODE_DIFFSORTORDER);
  4002.   DBIERR_DIRINUSEBYOLDVER       = (ERRBASE_COMPATIBILITY + ERRCODE_DIRINUSEBYOLDVER);
  4003.   DBIERR_PDX35LDDRIVER          = (ERRBASE_COMPATIBILITY + ERRCODE_PDX35LDDRIVER);
  4004.  
  4005. { ERRCAT_OPTPARAM }
  4006. { =============== }
  4007.  
  4008.   ERRCODE_REQOPTPARAM           = 1;      { Required optional parameter missing }
  4009.   ERRCODE_INVALIDOPTPARAM       = 2;      { Optional param out-of-range or bad }
  4010.  
  4011.  
  4012.   DBIERR_REQOPTPARAM            = (ERRBASE_OPTPARAM + ERRCODE_REQOPTPARAM);
  4013.   DBIERR_INVALIDOPTPARAM        = (ERRBASE_OPTPARAM + ERRCODE_INVALIDOPTPARAM);
  4014.  
  4015. {  ERRCAT_REPOSITORY }
  4016. {  ================= }
  4017.  
  4018.   ERRCODE_REPOSITORYCORRUPT     = 1;    { Data Repository is corrupt }
  4019.   ERRCODE_INFOBLOBCORRUPT       = 2;    { Info Blob corrupted }
  4020.   ERRCODE_SCHEMACORRUPT         = 3;    { DR Schema is corrupt }
  4021.   ERRCODE_ATTRTYPEEXISTS        = 4;    { Attribute Type exists }
  4022.   ERRCODE_INVALIDOBJTYPE        = 5;    { Invalid Object Type }
  4023.   ERRCODE_INVALIDRELATIONTYPE   = 6;    { Invalid Relation Type }
  4024.   ERRCODE_VIEWEXISTS            = 7;    { View already exists }
  4025.   ERRCODE_NOSUCHVIEW            = 8;    { No such View exists }
  4026.   ERRCODE_INVALIDRECCONSTRAINT  = 9;    { Invalid Record Constraint }
  4027.   ERRCODE_LDBCONNECTION         = 10;   { Object is in a Logical DB }
  4028.   ERRCODE_REPOSITORYEXISTS      = 11;   { Repository already exists }
  4029.   ERRCODE_NOSUCHREPOSITORY      = 12;   { Repository does not exist }
  4030.   ERRCODE_REPOSITORYDBMISSING   = 13;   { Repository database does not exist }
  4031.   ERRCODE_REPOSITORYOUTOFDATE   = 14;   { Repository info is out of date }
  4032.   ERRCODE_REPOSITORYVERSION     = 15;   { DR Version mismatch }
  4033.   ERRCODE_REPOSITORYNAME        = 16;   { Invalid Repository name }
  4034.   ERRCODE_DEPENDENTOBJECTS      = 17;   { Dependent Objects exist }
  4035.   ERRCODE_RELATIONLIMIT         = 18;   { Too many Relationships for this Object Type }
  4036.   ERRCODE_RELATIONSHIPSEXIST    = 19;   { Relationships to the Object exist }
  4037.   ERRCODE_EXCHANGEFILECORRUPT   = 20;   { Exchange File Corrupt }
  4038.   ERRCODE_EXCHANGEFILEVERSION   = 21;   { Exchange File Version Mismatch }
  4039.   ERRCODE_TYPEMISMATCH          = 22;   { Exchange File and Repository Types don't match }
  4040.   ERRCODE_OBJECTEXISTS          = 23;   { Object Exists in the Target Repository }
  4041.   ERRCODE_REPOSITORYACCESS      = 24;   { Access to Repository Denied }
  4042.   ERRCODE_REPOSITORYCREATE      = 25;   { Cannot Create Repository }
  4043.   ERRCODE_DATABASEOPENFAILED    = 26;   { Cannot Open a Database }
  4044.  
  4045.  
  4046.   DBIERR_REPOSITORYCORRUPT      = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYCORRUPT);
  4047.   DBIERR_INFOBLOBCORRUPT        = (ERRBASE_REPOSITORY + ERRCODE_INFOBLOBCORRUPT);
  4048.   DBIERR_SCHEMACORRUPT          = (ERRBASE_REPOSITORY + ERRCODE_SCHEMACORRUPT);
  4049.   DBIERR_ATTRTYPEEXISTS         = (ERRBASE_REPOSITORY + ERRCODE_ATTRTYPEEXISTS);
  4050.   DBIERR_INVALIDOBJTYPE         = (ERRBASE_REPOSITORY + ERRCODE_INVALIDOBJTYPE);
  4051.   DBIERR_INVALIDRELATIONTYPE    = (ERRBASE_REPOSITORY + ERRCODE_INVALIDRELATIONTYPE);
  4052.   DBIERR_VIEWEXISTS             = (ERRBASE_REPOSITORY + ERRCODE_VIEWEXISTS);
  4053.   DBIERR_NOSUCHVIEW             = (ERRBASE_REPOSITORY + ERRCODE_NOSUCHVIEW);
  4054.   DBIERR_INVALIDRECCONSTRAINT   = (ERRBASE_REPOSITORY + ERRCODE_INVALIDRECCONSTRAINT);
  4055.   DBIERR_LDBCONNECTION          = (ERRBASE_REPOSITORY + ERRCODE_LDBCONNECTION);
  4056.   DBIERR_REPOSITORYEXISTS       = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYEXISTS);
  4057.   DBIERR_NOSUCHREPOSITORY       = (ERRBASE_REPOSITORY + ERRCODE_NOSUCHREPOSITORY);
  4058.   DBIERR_REPOSITORYDBMISSING    = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYDBMISSING);
  4059.   DBIERR_REPOSITORYOUTOFDATE    = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYOUTOFDATE);
  4060.   DBIERR_REPOSITORYVERSION      = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYVERSION);
  4061.   DBIERR_REPOSITORYNAME         = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYNAME);
  4062.   DBIERR_DEPENDENTOBJECTS       = (ERRBASE_REPOSITORY + ERRCODE_DEPENDENTOBJECTS);
  4063.   DBIERR_RELATIONLIMIT          = (ERRBASE_REPOSITORY + ERRCODE_RELATIONLIMIT);
  4064.   DBIERR_RELATIONSHIPSEXIST     = (ERRBASE_REPOSITORY + ERRCODE_RELATIONSHIPSEXIST);
  4065.   DBIERR_EXCHANGEFILECORRUPT    = (ERRBASE_REPOSITORY + ERRCODE_EXCHANGEFILECORRUPT);
  4066.   DBIERR_EXCHANGEFILEVERSION    = (ERRBASE_REPOSITORY + ERRCODE_EXCHANGEFILEVERSION);
  4067.   DBIERR_TYPEMISMATCH           = (ERRBASE_REPOSITORY + ERRCODE_TYPEMISMATCH);
  4068.   DBIERR_OBJECTEXISTS           = (ERRBASE_REPOSITORY + ERRCODE_OBJECTEXISTS);
  4069.   DBIERR_REPOSITORYACCESS       = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYACCESS);
  4070.   DBIERR_REPOSITORYCREATE       = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYCREATE);
  4071.   DBIERR_DATABASEOPENFAILED     = (ERRBASE_REPOSITORY + ERRCODE_DATABASEOPENFAILED);
  4072.  
  4073. {============================================================================}
  4074. {                          DBI prototypes                                    }
  4075. {============================================================================}
  4076. {                          Environmental                                     }
  4077. {----------------------------------------------------------------------------}
  4078.  
  4079. function DbiInitFn (                    { Initialize the Engine }
  4080.       iVer          : Word;             { Interface Version }
  4081.       pEnv          : pDBIEnv           { Environment Structure/NULL }
  4082.    ): DBIResult stdcall;
  4083.  
  4084.  { DO NOT CALL THIS DIRECTLY. Use the 'DbiInit' define below. }
  4085.  
  4086.  { Initializes the engine environment. Default settings can be overwritten  }
  4087.  { by supplying the appropriate settings. Defaults are read from the system }
  4088.  { configuration file. pEnv can be NULLP to get the system defautls.        }
  4089.  
  4090. function DbiInit (pEnv: PDbiEnv): DBIResult stdcall;
  4091.  
  4092. function DbiExit: DBIResult stdcall;            { Exit engine }
  4093.  
  4094. function DbiDLLExit: DBIResult stdcall;         { Exit DLL }
  4095.  
  4096. {============================================================================}
  4097. {                         System Level Info                                  }
  4098. {============================================================================}
  4099.  
  4100. function DbiGetSysVersion (             { Get system version info }
  4101. var   sysVersion    : SYSVersion
  4102.    ): DBIResult stdcall;
  4103.  
  4104. function DbiGetSysConfig (              { System configuration }
  4105. var   sysConfig     : SYSConfig
  4106.    ): DBIResult stdcall;
  4107.  
  4108. function DbiGetClientInfo (             { Get Client info }
  4109. var   clientInfo    : CLIENTInfo
  4110.    ): DBIResult stdcall;
  4111.  
  4112. function DbiGetSysInfo (                { Get system status/info }
  4113. var   sysInfo       : SYSInfo
  4114.    ): DBIResult stdcall;
  4115.  
  4116. function DbiLoadDriver (                { Load a given driver }
  4117.       pszDriverType : PChar             { Driver name }
  4118.    ): DBIResult stdcall;
  4119.  
  4120. {============================================================================}
  4121. {                            Sessions                                        }
  4122. {============================================================================}
  4123.  
  4124. function DbiStartSession (              { Start a new session }
  4125.       pszName       : PChar;            { Name (Optional) }
  4126. var   hSes          : hDBISes;          { Session }
  4127.       pNetDir       : PChar             { Netfile directory for session (opt) }
  4128.    ): DBIResult stdcall;
  4129.  
  4130. function DbiGetCurrSession (            { Get the current session }
  4131. var   hSes          : hDBISes           { Session }
  4132.    ): DBIResult stdcall;
  4133.  
  4134. function DbiSetCurrSession (            { Set the current session }
  4135.       hSes          : hDBISes           { Session/NULL }
  4136.    ): DBIResult stdcall;
  4137.  
  4138. function DbiCloseSession (              { Close the current session }
  4139.       hSes          : hDBISes           { Session }
  4140.    ): DBIResult stdcall;
  4141.  
  4142. function DbiGetSesInfo (                { Get current session info }
  4143. var   sesInfo       : SESInfo
  4144.    ): DBIResult stdcall;
  4145.  
  4146. function DbiSetPrivateDir (             { Set Private Directory for session }
  4147.       pszDir        : PChar             { Directory name/NULL }
  4148.    ): DBIResult stdcall;
  4149.  
  4150.  
  4151. {============================================================================}
  4152. {                     Datababase, Schema and File inquiry                    }
  4153. {============================================================================}
  4154.  
  4155. function DbiOpenDatabase (              { Open a database }
  4156.       pszDbName     : PChar;            { Database name }
  4157.       pszDbType     : PChar;            { Database type (NULL: Universal) }
  4158.       eOpenMode     : DBIOpenMode;      { Open type }
  4159.       eShareMode    : DBIShareMode;     { Share type }
  4160.       pszPassword   : PChar;            { Password }
  4161.       iOptFlds      : Word;             { Number of optional Params }
  4162.       pOptFldDesc   : pFLDDesc;         { Optional Field Descriptors }
  4163.       pOptParams    : Pointer;          { Optional Params }
  4164. var   hDb           : hDBIDb            { Returnd database handle }
  4165.    ): DBIResult stdcall;
  4166.  
  4167. function DbiSetDirectory (              { Set the current directory }
  4168.       hDb           : hDBIDb;           { Universal database handle }
  4169.       pszDir        : PChar             { Directory/NULL }
  4170.    ): DBIResult stdcall;
  4171.  
  4172. function DbiGetDirectory (              { Get the current/default directory }
  4173.       hDb           : hDBIDb;           { Universal database handle }
  4174.       bDefault      : Bool;             { True for default }
  4175.       pszDir        : PChar             { Returned directory }
  4176.    ): DBIResult stdcall;
  4177.  
  4178. function DbiOpenTableList (             { Open a cursor on "Tables" }
  4179.       hDb           : hDBIDb;           { Database handle }
  4180.       bExtended     : Bool;             { True for extended info }
  4181.       bSystem       : Bool;             { True to include system tables }
  4182.       pszWild       : PChar;            { Wild card name }
  4183. var   hCur          : hDBICur           { Returned cursor }
  4184.    ): DBIResult stdcall;
  4185.  
  4186. function DbiOpenFileList (              { Open a cursor on "Files" }
  4187.       hDb           : hDBIDb;           { Universal database handle }
  4188.       pszWild       : PChar;            { Wild card name }
  4189. var   hCur          : hDBICur           { Returned cursor }
  4190.    ): DBIResult stdcall;
  4191.  
  4192. function DbiOpenIndexList (             { Return "Indexes" for a table }
  4193.       hDb           : hDBIDb;           { Database handle }
  4194.       pszTableName  : PChar;            { Table name }
  4195.       pszDriverType : PChar;            { Driver type }
  4196. var   hCur          : hDBICur           { Returned cursor on "Indexes" }
  4197.    ): DBIResult stdcall;
  4198.  
  4199. function DbiOpenFieldList (             { Return "Fields" for a table }
  4200.       hDb           : hDBIDb;           { Database handle }
  4201.       pszTableName  : PChar;            { Table name }
  4202.       pszDriverType : PChar;            { Driver type }
  4203.       bPhyTypes     : Bool;             { True, for physical types }
  4204. var   hCur          : hDBICur           { Returned cursor on "Fields" }
  4205.    ): DBIResult stdcall;
  4206.  
  4207. function DbiOpenVchkList (              { Return "Checks" for a table }
  4208.       hDb           : hDBIDb;           { Database handle }
  4209.       pszTableName  : PChar;            { Table name }
  4210.       pszDriverType : PChar;            { Driver Type }
  4211. var   hChkCur       : hDBICur           { Returned cursor on "Checks" }
  4212.    ): DBIResult stdcall;
  4213.  
  4214. function DbiOpenRintList (              { Return Integrity checks }
  4215.       hDb           : hDBIDb;           { Database handle }
  4216.       pszTableName  : PChar;            { Table name }
  4217.       pszDriverType : PChar;            { Driver type }
  4218. var   hChkCur       : hDBICur           { Returned cursor on "Ref Int". }
  4219.    ): DBIResult stdcall;
  4220.  
  4221. function DbiOpenSecurityList (          { Return security descriptions }
  4222.       hDb           : hDBIDb;           { Database handle }
  4223.       pszTableName  : PChar;            { Table name }
  4224.       pszDriverType : PChar;            { Driver type }
  4225. var   hSecCur       : hDBICur           { Returned cursor on sec list }
  4226.    ): DBIResult stdcall;
  4227.  
  4228. function DbiOpenFamilyList (            { Return family members }
  4229.       hDb           : hDBIDb;           { Database handle }
  4230.       pszTableName  : PChar;            { Table name }
  4231.       pszDriverType : PChar;            { Driver type }
  4232. var   hFmlCur       : hDBICur           { Returned cursor on "Family" }
  4233.    ): DBIResult stdcall;
  4234.  
  4235. function DbiOpenSPList (                { Open a cursor on "Stored Procedures" }
  4236.       hDb           : hDBIDb;           { Universal database handle }
  4237.       bExtended     : Bool;             { True for extended info (N/A) }
  4238.       bSystem       : Bool;             { True to include system procedures }
  4239.       pszQual       : PChar;            { Qualifier (N/A) }
  4240. var   hCur          : hDBICur           { Returned cursor }
  4241.    ): DBIResult stdcall;
  4242.  
  4243. function DbiOpenSPParamList (           { Return "Parameters" for a stored procedure }
  4244.       hDb           : hDBIDb;           { Database handle }
  4245.       pszSPName     : PChar;            { Stored procedure name }
  4246.       bPhyTypes     : Bool;             { True, for physical types }
  4247.       uOverload     : Word;             { Overload number }
  4248. var   hCur          : hDBICur           { Returned cursor on "Parameters" }
  4249.    ): DBIResult stdcall;
  4250.  
  4251. function DbiOpenFunctionList (          { Open a cursor on "Functions" }
  4252.       hDb           : hDBIDb;           { Universal database handle }
  4253.       eoptBits      : DBIFUNCOpts;      { Options for function list }
  4254.       phCur         : phDBICur          { Returned cursor on "Functions" }
  4255.                                         { Record desc is of type DBIFUNCDesc }
  4256.    ): DBIResult stdcall;
  4257.  
  4258. function DbiOpenFunctionArgList (       { Return "Arguments" for a function }
  4259.       hDb           : hDBIDb;           { Database handle }
  4260.       pszFuncName   : PChar;            { Function name }
  4261.       uOverload     : Word;             { Overload number }
  4262.       phCur         : phDBICur          { Returned cursor on "Arguments" }
  4263.    ): DBIResult stdcall;
  4264.  
  4265. function DbiCloseDatabase (             { Close a database }
  4266. var   hDb           : hDBIDb            { Pointer to database handle }
  4267.    ): DBIResult stdcall;
  4268.  
  4269. {============================================================================}
  4270. {                                  Capabilities                              }
  4271. {============================================================================}
  4272.  
  4273. function DbiOpenDriverList (            { Get a list of driver names }
  4274. var   hCur          : hDBICur           { Returned cursor }
  4275.    ): DBIResult stdcall;
  4276.  
  4277. function DbiGetDriverDesc (             { Get description for a given type }
  4278.       pszDriverType : PChar;            { Symbolic name for driver type }
  4279. var   drvType       : DRVType           { Driver type description }
  4280.    ): DBIResult stdcall;
  4281.  
  4282. function DbiOpenDatabaseList (          { Get a list of registered databases }
  4283. var   hCur          : hDBICur           { Returned cursor }
  4284.    ): DBIResult stdcall;
  4285.  
  4286. function DbiGetDatabaseDesc (           { Get a description of a logical db }
  4287.       pszName       : PChar;            { Name of logical database }
  4288.       pdbDesc       : pDBDesc           { Database description }
  4289.    ): DBIResult stdcall;
  4290.  
  4291. function DbiOpenTableTypesList (        { Get a list of table types }
  4292.       pszDriverType : PChar;            { Driver type }
  4293. var   hCur          : hDBICur           { Returned cursor }
  4294.    ): DBIResult stdcall;
  4295.  
  4296. function DbiGetTableTypeDesc (          { Get Table capabilities }
  4297.       pszDriverType : PChar;            { Driver type }
  4298.       pszTableType  : PChar;            { Table type }
  4299. var   tblType       : TBLType           { Table Capabilities }
  4300.    ): DBIResult stdcall;
  4301.  
  4302.  
  4303. function DbiOpenFieldTypesList (        { Get a list of field types }
  4304.       pszDriverType : PChar;            { Driver type }
  4305.       pszTblType    : PChar;            { Table type (Optional) }
  4306. var   hCur          : hDBICur           { Returned cursor }
  4307.    ): DBIResult stdcall;
  4308.  
  4309. function DbiGetFieldTypeDesc (          { Get list of field types }
  4310.       pszDriverType : PChar;            { Driver type }
  4311.       pszTableType  : PChar;            { Table type }
  4312.       pszFieldType  : PChar;            { Field type  (Physical only) }
  4313. var   fldType       : FLDType           { Field type description }
  4314.    ): DBIResult stdcall;
  4315.  
  4316. function DbiOpenIndexTypesList (        { Get list of index types }
  4317.       pszDriverType : PChar;            { Driver type }
  4318. var   hCur          : hDBICur           { Returned cursor }
  4319.    ): DBIResult stdcall;
  4320.  
  4321. function DbiGetIndexTypeDesc (          { Get description of given idx type }
  4322.       pszDriverType : PChar;            { Driver type }
  4323.       pszIndexType  : PChar;            { Index type }
  4324. var   idxType       : IDXType           { Index description }
  4325.    ): DBIResult stdcall;
  4326.  
  4327. function DbiOpenLdList (                { Get a list of Lang Drivers }
  4328. var   hCur          : hDBICur           { Returned cursor }
  4329.    ): DBIResult stdcall;
  4330.  
  4331. {===========================================================================}
  4332. {                      Table Open, Properties & Structure                   }
  4333. {===========================================================================}
  4334.  
  4335. function DbiOpenTable (                 { Open a table }
  4336.       hDb           : hDBIDb;           { Database handle }
  4337.       pszTableName  : PChar;            { Table name or file name }
  4338.       pszDriverType : PChar;            { Driver type                 /NULL }
  4339.       pszIndexName  : PChar;            { Index to be used for access /NULL }
  4340.       pszIndexTagName : PChar;          { Index tag name              /NULL }
  4341.       iIndexId      : Word;             { Index number                /0 }
  4342.       eOpenMode     : DBIOpenMode;      { Read or RW }
  4343.       eShareMode    : DBIShareMode;     { Excl or Share }
  4344.       exltMode      : XLTMode;          { Xlate mode }
  4345.       bUniDirectional : Bool;           { Uni or Bi directional }
  4346.       pOptParams    : Pointer;          { Optional params /NULL }
  4347. var   hCursor       : hDBICur           { Returns Cursor handle }
  4348.    ): DBIResult stdcall;
  4349.  
  4350.  
  4351. function DbiGetCursorProps (            { Get Cursor properties }
  4352.       hCursor       : hDBICur;          { Cursor handle }
  4353. var   curProps      : CURProps          { Cursor properties }
  4354.    ): DBIResult stdcall;
  4355.  
  4356. function DbiGetObjFromName (            { Get object from name }
  4357.       eObjType      : DBIOBJType;       { Object handle }
  4358.       pszObjName    : PChar;            { Name of object /NULL }
  4359. var   hObj          : hDBIObj           { Returned object handle }
  4360.    ): DBIResult stdcall;
  4361.  
  4362. function DbiGetObjFromObj (             { Get associated object }
  4363.       hObj          : hDBIObj;          { Object handle }
  4364.       eObjType      : DBIOBJType;       { Type of associated object }
  4365. var   hObjOut       : hDBIObj           { Returns object of eObjType }
  4366.    ): DBIResult stdcall;
  4367.  
  4368. function DbiGetProp (                   { Get property }
  4369.       hObj          : hDBIObj;          { Object handle }
  4370.       iProp         : Longint;          { Property to retrieve }
  4371.       PropValue     : Pointer;          { == NULL, validate iProp for getting }
  4372.       iMaxLen       : Word;             { Length of buffer pPropValue }
  4373. var   iLen          : Word              { Returns required length }
  4374.    ): DBIResult stdcall;
  4375.  
  4376. function DbiSetProp (                   { Set property }
  4377.       hObj          : hDBIObj;          { Object handle }
  4378.       iProp         : Longint;          { Property to set }
  4379.       iPropValue    : Longint           { Property value }
  4380.    ): DBIResult stdcall;
  4381.  
  4382. function DbiValidateProp (              { Validate a property }
  4383.       hObj          : hDBIObj;          { Object handle }
  4384.       iProp         : Longint;          { property to validate }
  4385.       bSetting      : Bool              { TRUE:setting, FALSE:getting }
  4386.    ): DBIResult stdcall;
  4387.  
  4388. function DbiGetFieldDescs (             { Get field descriptions }
  4389.       hCursor       : hDBICur;          { Cursor handle }
  4390.       pfldDesc      : pFLDDesc          { Array of field descriptors }
  4391.    ): DBIResult stdcall;
  4392.  
  4393. function DbiGetCursorForTable (         { Find cursor for a given table }
  4394.       hDb           : hDBIDb;           { Database handle }
  4395.       pszTableName  : PChar;            { Table name }
  4396.       pszDriverType : PChar;            { Driver type / NULL }
  4397. var   hCursor       : hDBICur           { Returned cursor }
  4398.    ): DBIResult stdcall;
  4399.  
  4400. function DbiCloneCursor (               { Return a duplicate cursor }
  4401.       hCurSrc       : hDBICur;          { Source cursor }
  4402.       bReadOnly     : Bool;             { If TRUE, read only mode }
  4403.       bUniDirectional : Bool;           { If TRUE, Uni directional }
  4404. var   hCurNew       : hDBICur           { Destination cursor address }
  4405.    ): DBIResult stdcall;
  4406.  
  4407. function DbiCloseCursor (               { Closes cursor }
  4408. var   hCursor       : hDBICur           { Pntr to Cursor handle }
  4409.    ): DBIResult stdcall;
  4410.  
  4411.  
  4412. {============================================================================}
  4413. {                      Index Manipulation & Usage                            }
  4414. {============================================================================}
  4415.  
  4416. function DbiOpenIndex (                 { Open an index }
  4417.       hCursor       : hDBICur;          { Cursor handle }
  4418.       pszIndexName  : PChar;            { Index Name }
  4419.       iIndexId      : Word              { Index number (if applicable) }
  4420.    ): DBIResult stdcall;
  4421.  
  4422. function DbiCloseIndex (                { Close an index }
  4423.       hCursor       : hDBICur;          { Cursor handle }
  4424.       pszIndexName  : PChar;            { Index Name }
  4425.       iIndexId      : Word              { Index number }
  4426.    ): DBIResult stdcall;
  4427.  
  4428. function DbiSwitchToIndex (             { Change index order of access }
  4429. var   hCursor       : hDBICur;          { Cursor handle (In/Out) }
  4430.       pszIndexName  : PChar;            { Index name }
  4431.       pszTagName    : PChar;            { Tag name (if applicable) }
  4432.       iIndexId      : Word;             { Index number }
  4433.       bCurrRec      : Bool              { Position at current rec }
  4434.    ): DBIResult stdcall;
  4435.  
  4436. function DbiGetIndexDesc (              { Get index properties }
  4437.       hCursor       : hDBICur;          { Cursor handle }
  4438.       iIndexSeqNo   : Word;             { Index number }
  4439. var   idxDesc       : IDXDesc           { Returned index description }
  4440.    ): DBIResult stdcall;
  4441.  
  4442. function DbiGetIndexDescs (             { Get index properties }
  4443.       hCursor       : hDBICur;          { Cursor handle }
  4444.       idxDesc       : PIDXDesc          { Returned index descriptors }
  4445.    ): DBIResult stdcall;
  4446.  
  4447. function DbiGetIndexForField (          { Get index desc for given field }
  4448.       hCursor       : hDBICur;          { Cursor handle }
  4449.       iFld          : Word;             { Field Number (1..N) }
  4450.       bProdTagOnly  : Bool;             { If TRUE, only xBASE prod tags will be returned }
  4451. var   idxDesc       : IDXDesc           { (Optional) }
  4452.    ): DBIResult stdcall;
  4453.  
  4454. function DbiGetIndexSeqNo (             { Get index sequence number }
  4455.       hCursor       : hDBICur;          { Cursor handle }
  4456.       pszIndexName  : PChar;            { Index name }
  4457.       pszTagName    : PChar;            { Tag name (if applicable) }
  4458.       iIndexId      : Word;             { Index number }
  4459. var   iIndexSeqNo   : Word              { Index number }
  4460.    ): DBIResult stdcall;
  4461.  
  4462. function DbiSetToKey (                  { Set key condition }
  4463.       hCursor       : hDBICur;          { Cursor handle }
  4464.       eSearchCond   : DBISearchCond;    { Search condition (default is =) }
  4465.       bDirectKey    : Bool;             { Key is supplied directly }
  4466.       iFields       : Word;             { No of full fields to match }
  4467.       iLen          : Word;             { Partial key len of last field }
  4468.       pBuff         : Pointer           { Either Record buffer or Key itself }
  4469.    ): DBIResult stdcall;
  4470.  
  4471. function DbiExtractKey (                { Get the key value of current record }
  4472.       hCursor       : hDBICur;          { Cursor handle }
  4473.       pRecBuf       : Pointer;          { Record buffer (optional) }
  4474.       pKeyBuf       : Pointer           { Returned. Key bytes. }
  4475.    ): DBIResult stdcall;
  4476.  
  4477. function DbiSetRange (                  { Set cursor to a range }
  4478.       hCursor       : hDBICur;          { Cursor }
  4479.       bKeyItself    : Bool;             { Whether Key or Record buffer }
  4480.       iFields1      : Word;             { Key fields to be mathced in full }
  4481.       iLen1         : Word;             { Key length to compare }
  4482.       pKey1         : Pointer;          { Top/Left key in Range }
  4483.       bKey1Incl     : Bool;             { If Inclusive of Key1 }
  4484.       iFields2      : Word;             { Key fields to be mathced in full }
  4485.       iLen2         : Word;             { Key length to compare }
  4486.       pKey2         : Pointer;          { Bottom/Right key in Range }
  4487.       bKey2Incl     : Bool              { If Inclusive of Key2 }
  4488.    ): DBIResult stdcall;
  4489.  
  4490. function DbiResetRange (                { Reset range }
  4491.       hCursor       : hDBICur           { cursor handle }
  4492.    ): DBIResult stdcall;
  4493.  
  4494. function DbiCompareKeys (               { Compare two keys }
  4495.       hCursor       : hDBICur;          { Cursor handle }
  4496.       pKey1         : Pointer;          { Key buffer 1 to compare }
  4497.       pKey2         : Pointer;          { Key buffer 2 (Or NULL) }
  4498.       iFields       : Word;             { Fields to compare in full }
  4499.       iLen          : Word;             { Partial key to compare }
  4500. var   iResult       : SmallInt          { Compare result }
  4501.    ): DBIResult stdcall;
  4502.  
  4503. function DbiGetRecordForKey (           { Find a record matching key }
  4504.       hCursor       : hDBICur;          { Cursor handle }
  4505.       bDirectKey    : Bool;             { Key is supplied directly }
  4506.       iFields       : Word;             { No of full fields to match }
  4507.       iLen          : Word;             { Partial key len of last field }
  4508.       pKey          : Pointer;          { Either Record buffer or Key itself }
  4509.       pRecBuff      : Pointer           { (Optional) Record buffer }
  4510.    ): DBIResult stdcall;
  4511.  
  4512. {=============================================================================}
  4513. {                          Validity check and referential integrity           }
  4514. {=============================================================================}
  4515.  
  4516. function DbiGetVchkDesc (               { Get valcheck descriptor }
  4517.       hCursor       : hDBICur;          { Cursor handle }
  4518.       iValSeqNo     : Word;             { Valcheck sequence number }
  4519.       pvalDesc      : pVCHKDesc         { Returned valcheck description }
  4520.    ): DBIResult stdcall;
  4521.  
  4522. function DbiGetRintDesc (               { Get referential integrity descriptor }
  4523.       hCursor       : hDBICur;          { Cursor handle }
  4524.       iRintSeqNo    : Word;             { Rint sequence number }
  4525.       printDesc     : pRINTDesc         { Returned rint description }
  4526.    ): DBIResult stdcall;
  4527.  
  4528. {=============================================================================}
  4529. {                              Cursor Maintenance                             }
  4530. {=============================================================================}
  4531.  
  4532.  
  4533. function DbiSetToBegin (                { Reset cursor to beginning }
  4534.       hCursor       : hDBICur           { Cursor handle }
  4535.    ): DBIResult stdcall;
  4536.  
  4537. function DbiSetToEnd (                  { Reset cursor to ending }
  4538.       hCursor       : hDBICur           { Cursor handle }
  4539.    ): DBIResult stdcall;
  4540.  
  4541. function DbiSetToCursor (               { Set cursor to another cursor position }
  4542.       hDest         : hDBICur;          { Destination cursor }
  4543.       hSrc          : hDBICur           { Source cursor }
  4544.    ): DBIResult stdcall;
  4545.  
  4546. function DbiGetBookMark (               { Get a book-mark }
  4547.       hCur          : hDBICur;          { Cursor }
  4548.       pBookMark     : Pointer           { Pointer to Book-Mark }
  4549.    ): DBIResult stdcall;
  4550.  
  4551. function DbiSetToBookMark (             { Position to a Book-Mark }
  4552.       hCur          : hDBICur;          { Cursor }
  4553.       pBookMark     : Pointer           { Pointer to Book-Mark }
  4554.    ): DBIResult stdcall;
  4555.  
  4556. function DbiCompareBookMarks (          { Compare two Book-marks }
  4557.       hCur          : hDBICur;          { Cursor }
  4558.       pBookMark1    : Pointer;          { Book mark 1 }
  4559.       pBookMark2    : Pointer;          { Book mark 2 }
  4560. var   CmpBkmkResult : CmpBkmkRslt       { Compare result }
  4561.    ): DBIResult stdcall;
  4562.  
  4563. {============================================================================}
  4564. {                      Data Access: Logical Record Level                     }
  4565. {============================================================================}
  4566.  
  4567.  
  4568. function DbiGetNextRecord (             { Find/Get the next record }
  4569.       hCursor       : hDBICur;          { Cursor handle }
  4570.       eLock         : DBILockType;      { Optional lock request }
  4571.       pRecBuff      : Pointer;          { Record buffer(client) }
  4572.       precProps     : pRECProps         { Optional record properties }
  4573.    ): DBIResult stdcall;
  4574.  
  4575. function DbiGetPriorRecord (            { Find/Get the prior record }
  4576.       hCursor       : hDBICur;          { Cursor handle }
  4577.       eLock         : DBILockType;      { Optional lock request }
  4578.       pRecBuff      : Pointer;          { Record buffer (client) }
  4579.       precProps     : pRECProps         { Optional record properties }
  4580.    ): DBIResult stdcall;
  4581.  
  4582. function DbiGetRecord (                 { Gets the current record }
  4583.       hCursor       : hDBICur;          { Cursor handle }
  4584.       eLock         : DBILockType;      { Optional lock request }
  4585.       pRecBuff      : Pointer;          { Record buffer(client) }
  4586.       precProps     : pRECProps         { Optional record properties }
  4587.    ): DBIResult stdcall;
  4588.  
  4589. function DbiGetRelativeRecord (         { Find/Get a record by record number }
  4590.       hCursor       : hDBICur;          { Cursor handle }
  4591.       iPosOffset    : Longint;          { offset from current position }
  4592.       eLock         : DBILockType;      { Optional lock request }
  4593.       pRecBuff      : Pointer;          { Record buffer(client) }
  4594.       precProps     : pRECProps         { Optional record properties }
  4595.    ): DBIResult stdcall;
  4596.  
  4597. function DbiInitRecord (                { Initialize record area }
  4598.       hCursor       : hDBICur;          { Cursor handle }
  4599.       pRecBuff      : Pointer           { Record buffer }
  4600.    ): DBIResult stdcall;
  4601.  
  4602. function DbiInsertRecord (              { Inserts a new record }
  4603.       hCursor       : hDBICur;          { Cursor handle }
  4604.       eLock         : DBILockType;      { Optional lock on this rec }
  4605.       pRecBuff      : Pointer           { New Record (client) }
  4606.    ): DBIResult stdcall;
  4607.  
  4608. function DbiModifyRecord (              { Updates the current record }
  4609.       hCursor       : hDBICur;          { Cursor handle }
  4610.       pRecBuf       : Pointer;          { Modified record }
  4611.       bFreeLock     : Bool              { Free record lock }
  4612.    ): DBIResult stdcall;
  4613.  
  4614. function DbiDeleteRecord (              { Deletes the current record }
  4615.       hCursor       : hDBICur;          { Cursor handle }
  4616.       pRecBuf       : Pointer           { Copy of deleted record }
  4617.    ): DBIResult stdcall;
  4618.  
  4619. function DbiReadBlock (                 { Read a block of records }
  4620.       hCursor       : hDBICur;          { Cursor handle }
  4621. var   iRecords      : Longint;          { Number of records to read }
  4622.       pBuf          : Pointer           { Buffer }
  4623.    ): DBIResult stdcall;
  4624.  
  4625. function DbiWriteBlock (                { Write a block of records }
  4626.       hCursor       : hDBICur;          { Cursor handle }
  4627. var   iRecords      : Longint;          { Number of records to write/written }
  4628.       pBuf          : Pointer           { Buffer }
  4629.    ): DBIResult stdcall;
  4630.  
  4631. function DbiAppendRecord (              { Inserts a new record }
  4632.       hCursor       : hDBICur;          { Cursor handle }
  4633.       pRecBuff      : Pointer           { New Record (client) }
  4634.    ): DBIResult stdcall;
  4635.  
  4636. function DbiUndeleteRecord (            { Undeletes the current record }
  4637.       hCursor       : hDBICur           { Cursor handle }
  4638.    ): DBIResult stdcall;
  4639.  
  4640. function DbiGetSeqNo (                  { Get logical record number }
  4641.       hCursor       : hDBICur;          { Cursor handle }
  4642. var   iSeqNo        : Longint           { Pointer to sequence number }
  4643.    ): DBIResult stdcall;
  4644.  
  4645. function DbiSetToSeqNo (                { Position to a logical record number }
  4646.       hCursor       : hDBICur;          { Cursor handle }
  4647.       iSeqNo        : Longint           { Sequence number }
  4648.    ): DBIResult stdcall;
  4649.  
  4650. function DbiGetRecordCount (            { Get the current number of records }
  4651.       hCursor       : hDBICur;          { Cursor handle }
  4652. var   iRecCount     : Longint           { Number of records }
  4653.    ): DBIResult stdcall;
  4654.  
  4655.  
  4656. function DbiGetExactRecordCount (       { Get the exact number of records }
  4657.       hCursor       : hDBICur;          { Cursor handle }
  4658. var   iRecCount     : Longint           { Number of records }
  4659.    ): DBIResult stdcall;
  4660.  
  4661.  
  4662. function DbiSetToRecordNo (             { Position to Physical Rec# }
  4663.       hCursor       : hDBICur;          { Cursor handle }
  4664.       iRecNo        : Longint           { Physical record number }
  4665.    ): DBIResult stdcall;
  4666.  
  4667. function DbiSaveChanges (               { Flush all buffered changes }
  4668.       hCursor       : hDBICur           { Cursor handle }
  4669.    ): DBIResult stdcall;
  4670.  
  4671. function DbiForceReread (               { Force Reread of buffers from Disk }
  4672.       hCursor       : hDBICur           { Cursor }
  4673.    ): DBIResult stdcall;
  4674.  
  4675. function DbiCheckRefresh: DBIResult stdcall;    { Check refresh for session }
  4676.  
  4677. function DbiMakePermanent (             { Make temporary table permanent }
  4678.       hCursor       : hDBICur;          { Cursor handle }
  4679.       pszName       : PChar;            { Rename temporary table }
  4680.       bOverWrite    : Bool              { Overwrite existing file }
  4681.    ): DBIResult stdcall;
  4682.  
  4683. function DbiForceRecordReread (         { Force Reread of current record from Server }
  4684.       hCursor       : hDBICur;          { Cursor handle }
  4685.       pRecBuff      : Pointer           { Returned : record buffer }
  4686.    ): DBIResult stdcall;
  4687.  
  4688. {============================================================================}
  4689. {                            Field Level Access                              }
  4690. {============================================================================}
  4691.  
  4692. function DbiGetField (                  { Get Field value }
  4693.       hCursor       : hDBICur;          { Cursor }
  4694.       iField        : Word;             { Field # (1..n) }
  4695.       pRecBuff      : Pointer;          { Record buffer }
  4696.       pDest         : Pointer;          { Destination field buffer }
  4697. var   bBlank        : Bool              { Returned : is field blank }
  4698.    ): DBIResult stdcall;
  4699.  
  4700. function DbiPutField (                  { Put a value in the record buffer }
  4701.       hCursor       : hDBICur;          { Cursor }
  4702.       iField        : Word;             { Field # (1..n) }
  4703.       pRecBuff      : Pointer;          { Record buffer }
  4704.       pSrc          : Pointer           { Source field buffer }
  4705.    ): DBIResult stdcall;
  4706.  
  4707. function DbiVerifyField (               { Verifies the field value }
  4708.       hCursor       : hDBICur;          { Cursor }
  4709.       iField        : Word;             { Field # (1..n) }
  4710.       pSrc          : Pointer;          { Field Value }
  4711. var   bBlank        : Bool              { Field is Blank (Returned) }
  4712.    ): DBIResult stdcall;
  4713.  
  4714. function DbiOpenBlob (                  { Open a blob for access }
  4715.       hCursor       : hDBICur;          { Cursor handle }
  4716.       pRecBuf       : Pointer;          { Record Buffer }
  4717.       iField        : Word;             { Field number (1..n) }
  4718.       eOpenMode     : DBIOpenMode       { Open for Read or RW }
  4719.    ): DBIResult stdcall;
  4720.  
  4721. function DbiGetBlobSize (               { Gets the size of a blob }
  4722.       hCursor       : hDBICur;          { Cursor handle }
  4723.       pRecBuf       : Pointer;          { Record Buffer }
  4724.       iField        : Word;             { Field number of blob (1..n) }
  4725. var   iSize         : Longint           { Blob size in bytes }
  4726.    ): DBIResult stdcall;
  4727.  
  4728. function DbiGetBlob (                   { Read bytes from blob }
  4729.       hCursor       : hDBICur;          { Cursor handle }
  4730.       pRecBuf       : Pointer;          { Record Buffer }
  4731.       iField        : Word;             { Field number of blob (1..n) }
  4732.       iOffSet       : Longint;          { Starting position }
  4733.       iLen          : Longint;          { No of bytes to be read }
  4734.       pDest         : Pointer;          { Destination }
  4735. var   iRead         : Longint           { Actual no of bytes read }
  4736.    ): DBIResult stdcall;
  4737.  
  4738. function DbiPutBlob (                   { Write bytes to blob }
  4739.       hCursor       : hDBICur;          { Cursor handle }
  4740.       pRecBuf       : Pointer;          { Record Buffer }
  4741.       iField        : Word;             { Field number of blob (1..n) }
  4742.       iOffSet       : Longint;          { Starting position }
  4743.       iLen          : Longint;          { No of bytes to put }
  4744.       pSrc          : Pointer           { pntr to Source }
  4745.    ): DBIResult stdcall;
  4746.  
  4747. function DbiTruncateBlob (              { Reduces the blob size }
  4748.       hCursor       : hDBICur;          { Cursor handle }
  4749.       pRecBuf       : Pointer;          { Record Buffer }
  4750.       iField        : Word;             { Field number of blob (1..n) }
  4751.       iLen          : Longint           { New blob length }
  4752.    ): DBIResult stdcall;
  4753.  
  4754. function DbiFreeBlob (                  { Closes the blob }
  4755.       hCursor       : hDBICur;          { Cursor handle }
  4756.       pRecBuf       : Pointer;          { Record Buffer }
  4757.       iField        : Word              { Field number of blob (0..n) }
  4758.    ): DBIResult stdcall;
  4759.  
  4760. function DbiGetBlobHeading (            { Get Blob Heading }
  4761.       hCursor       : hDBICur;          { Cursor handle }
  4762.       iField        : Word;             { Field number of blob (1..n) }
  4763.       pRecBuf       : Pointer;          { Record buffer of owner record }
  4764.       pDest         : Pointer           { Destination buffer }
  4765.    ): DBIResult stdcall;
  4766.  
  4767. function DbiSetFieldMap (               { Set a fieldmap }
  4768.       hCur          : hDBICur;          { Cursor handle }
  4769.       iFields       : Word;             { Number of fields }
  4770.       pFldDesc      : pFLDDesc          { Array of field descriptions }
  4771.    ): DBIResult stdcall;
  4772.  
  4773.  
  4774. {=============================================================================}
  4775. {                                TRANSACTIONS                                 }
  4776. {=============================================================================}
  4777.  
  4778. function DbiBeginTran (                 { Begin a transaction }
  4779.       hDb           : hDBIDb;           { Database handle }
  4780.       eXIL          : eXILType;         { Transaction isolation level }
  4781. var   hXact         : hDBIXact          { Returned Xact handle }
  4782.    ): DBIResult stdcall;
  4783.  
  4784. function DbiEndTran (                   { End a transaction }
  4785.       hDb           : hDBIDb;           { Database handle }
  4786.       hXact         : hDBIXact;         { Xact handle }
  4787.       eEnd          : eXEnd             { Xact end type }
  4788.    ): DBIResult stdcall;
  4789.  
  4790. function DbiGetTranInfo (               { Get transaction info }
  4791.       hDb           : hDBIDb;           { Database handle }
  4792.       hXact         : hDBIXact;         { Xact handle }
  4793.       pxInfo        : pXInfo            { Xact info }
  4794.    ): DBIResult stdcall;
  4795.  
  4796. {=============================================================================}
  4797. {                                  LOCKING                                    }
  4798. {=============================================================================}
  4799.  
  4800. function DbiAcqTableLock (              { Lock a table }
  4801.       hCursor       : hDBICur;          { Cursor handle }
  4802.       eLockType     : DBILockType       { Lock type }
  4803.    ): DBIResult stdcall;
  4804.  
  4805. function DbiAcqPersistTableLock (       { Get a persistent lock }
  4806.       hDb           : hDBIDb;           { Database handle }
  4807.       pszTableName  : PChar;            { Table name }
  4808.       pszDriverType : PChar             { Driver type / NULL }
  4809.    ): DBIResult stdcall;
  4810.  
  4811. function DbiRelPersistTableLock (       { Releases a persistent lock }
  4812.       hDb           : hDBIDb;           { Database handle }
  4813.       pszTableName  : PChar;            { Table name }
  4814.       pszDriverType : PChar             { Driver type / NULL }
  4815.    ): DBIResult stdcall;
  4816.  
  4817. function DbiRelTableLock (              { Unlocks Table level locks }
  4818.       hCursor       : hDBICur;          { Cursor handle }
  4819.       bAll          : Bool;             { True for all table level locks }
  4820.       eLockType     : DBILockType       { Specific lock type }
  4821.    ): DBIResult stdcall;
  4822.  
  4823. function DbiRelRecordLock (             { Releases record level locks }
  4824.       hCursor       : hDBICur;          { Cursor handle }
  4825.       bAll          : Bool              { True for all. Default Current. }
  4826.    ): DBIResult stdcall;
  4827.  
  4828. function DbiIsRecordLocked (            { Check if current record is locked }
  4829.       hCursor       : hDBICur;          { Cursor handle }
  4830. var   bLocked       : Bool              { Rec lock status }
  4831.    ): DBIResult stdcall;
  4832.  
  4833. function DbiIsTableLocked (             { Verify if Table is locked }
  4834.       hCursor       : hDBICur;          { Cursor handle }
  4835.       epdxLock      : DBILockType;      { Lock type to verify }
  4836. var   iLocks        : Word              { Nbr of locks of the given type }
  4837.    ): DBIResult stdcall;
  4838.  
  4839. function DbiIsTableShared (             { Verify if this is a shared table }
  4840.       hCursor       : hDBICur;          { Cursor handle }
  4841. var   bShared       : Bool              { Shared status }
  4842.    ): DBIResult stdcall;
  4843.  
  4844. function DbiOpenLockList (              { Get a list of locks }
  4845.       hCursor       : hDBICur;          { Cursor handle }
  4846.       bAllUsers     : Bool;             { True, for all Users locks }
  4847.       bAllLockTypes : Bool;             { True, for all lock types }
  4848. var   hLocks        : hDBICur           { Returned cursor on Lock list }
  4849.    ): DBIResult stdcall;
  4850.  
  4851. function DbiOpenUserList (              { Get a list of users loggedin }
  4852. var   hUsers        : hDBICur           { Returned cursor on user list }
  4853.    ): DBIResult stdcall;
  4854.  
  4855. function DbiSetLockRetry (              { Set Lock wait time }
  4856.       iWait         : SmallInt          { Time in seconds }
  4857.    ): DBIResult stdcall;
  4858.  
  4859. {============================================================================}
  4860. {                              Batch Operations                              }
  4861. {============================================================================}
  4862.  
  4863.  
  4864. function DbiBatchMove (                 { Copy records to destination table }
  4865.       pSrcTblDesc   : pBATTblDesc;      { Source table identification, }
  4866.       hSrcCur       : hDBICur;          {  OR source cursor  ( one must be NULL ) }
  4867.       pDstTblDesc   : pBATTblDesc;      { Destination table identification, }
  4868.       hDstCur       : hDBICur;          {  OR destination cursor ( one must be NULL ) }
  4869.       ebatMode      : eBATMode;         { Batch mode }
  4870.       iFldCount     : Word;             { Size of field maps }
  4871.       pSrcFldMap    : PWord;            { Array of source field numbers }
  4872.       pszIndexName  : PChar;            { If update mode, used to match records }
  4873.       pszIndexTagName : PChar;          { Index tag name }
  4874.       iIndexId      : Word;             { Index  id }
  4875.       pszKeyviolName : PChar;           { Keyviol table name  (optional) }
  4876.       pszProblemsName : PChar;          { Problems table name (optional) }
  4877.       pszChangedName : PChar;           { Changed table name (optional) }
  4878.       lProbRecs     : PLongint;         { Number records written to problem table }
  4879.       lKeyvRecs     : PLongint;         { Number records written to keyv table }
  4880.       lChangedRecs  : PLongint;         { Number records written to changed table }
  4881.       bAbortOnFirstProb : Bool;         { If TRUE, abort on first problem rec }
  4882.       bAbortOnFirstKeyviol : Bool;      { If TRUE, abort on first keyviol rec }
  4883. var   lRecsToMove   : Longint;          { Number of records to read from source }
  4884.       bTransliterate : Bool             { If TRUE, transliterate character data }
  4885.    ): DBIResult stdcall;
  4886.  
  4887. function DbiCopyTable (                 { Copy one table to another }
  4888.       hDb           : hDBIDb;           { Database handle }
  4889.       bOverWrite    : Bool;             { True, to overwrite existing file }
  4890.       pszSrcTableName : PChar;          { Source table name }
  4891.       pszSrcDriverType : PChar;         { Source driver type }
  4892.       pszDestTableName : PChar          { Destination table name }
  4893.    ): DBIResult stdcall;
  4894.  
  4895. function DbiEmptyTable (                { Deletes all records }
  4896.       hDb           : hDBIDb;           { Database handle }
  4897.       hCursor       : hDBICur;          { Cursor (OR) }
  4898.       pszTableName  : PChar;            { Table name }
  4899.       pszDriverType : PChar             { Driver type /NULL }
  4900.    ): DBIResult stdcall;
  4901.  
  4902. function DbiPackTable (                 { Pack a table }
  4903.       hDb           : hDBIDb;           { Database handle }
  4904.       hCursor       : hDBICur;          { Cursor (OR) }
  4905.       pszTableName  : PChar;            { Table name }
  4906.       pszDriverType : PChar;            { Driver type /NULL }
  4907.       bRegenIdxs    : Bool              { Regenerate indexes }
  4908.    ): DBIResult stdcall;
  4909.  
  4910. function DbiRegenIndex (                { Regenerate an index }
  4911.       hDb           : hDBIDb;           { Database handle }
  4912.       hCursor       : hDBICur;          { Cursor (OR) }
  4913.       pszTableName  : PChar;            { Table name }
  4914.       pszDriverType : PChar;            { Driver type /NULL }
  4915.       pszIndexName  : PChar;            { Index name }
  4916.       pszIndexTagName : PChar;          { Index tagname (xbase MDX) }
  4917.       iIndexId      : Word              { Index number }
  4918.    ): DBIResult stdcall;
  4919.  
  4920. function DbiRegenIndexes (              { Regenerate all indexes }
  4921.       hCursor       : hDBICur           { Cursor }
  4922.    ): DBIResult stdcall;
  4923.  
  4924. function DbiSortTable (                 { Sort table }
  4925.       hDb           : hDBIDb;           { Database handle }
  4926.       pszTableName  : PChar;            { Table name of source }
  4927.       pszDriverType : PChar;            { Driver type /NULL }
  4928.       hSrcCur       : hDBICur;          { OR cursor of table to sort }
  4929.       pszSortedName : PChar;            { Destination table (NULL if sort to self) }
  4930.       phSortedCur   : phDBICur;         { If non-null, return cursor on destination }
  4931.       hDstCur       : hDBICur;          { OR cursor of destination }
  4932.       iSortFields   : Word;             { Number of sort fields }
  4933.       piFieldNum    : PWord;            { Array of field numbers }
  4934.       pbCaseInsensitive : PBool;        { Which fields should sort c-i (Opt) }
  4935.       pSortOrder    : pSORTOrder;       { Array of Sort orders (Opt) }
  4936.       ppfSortFn     : ppfSORTCompFn;    { Array of compare fn pntrs (Opt) }
  4937.       bRemoveDups   : Bool;             { TRUE : Remove duplicates }
  4938.       hDuplicatesCur : hDBICur;         { Cursor to duplicates table (Opt) }
  4939. var   lRecsSort     : Longint           { In/out param. - sort this number }
  4940.    ): DBIResult stdcall;
  4941.  
  4942.  
  4943. {============================================================================}
  4944. {                           Create & Restructure                             }
  4945. {============================================================================}
  4946.  
  4947. function DbiCreateTable (               { Create a new table }
  4948.       hDb           : hDBIDb;           { Database handle }
  4949.       bOverWrite    : Bool;             { True, to overwrite existing file. }
  4950. var   crTblDsc      : CRTblDesc         { Table description }
  4951.    ): DBIResult stdcall;
  4952.  
  4953. function DbiCreateInMemTable (          { Create a temporary table (Logical) }
  4954.       hDb           : hDBIDb;           { Database handle }
  4955.       pszName       : PChar;            { Logical Name }
  4956.       iFields       : Word;             { No of fields }
  4957.       pfldDesc      : pFLDDesc;         { Array of field descriptors }
  4958. var   hCursor       : hDBICur           { Returned cursor handle }
  4959.    ): DBIResult stdcall;
  4960.  
  4961. function DbiCreateTempTable (           { Create temporary table (Physical) }
  4962.       hDb           : hDBIDb;           { Database handle }
  4963. var   crTblDsc      : CRTblDesc;        { Table description }
  4964. var   hCursor       : hDBICur           { Returned cursor on table }
  4965.    ): DBIResult stdcall;
  4966.  
  4967. function DbiDoRestructure (             { Restructure a table }
  4968.       hDb           : hDBIDb;           { Database handle }
  4969.       iTblDescCount : Word;             { Number of table descriptors (1) }
  4970.       pTblDesc      : pCRTblDesc;       { Array of table descs }
  4971.       pszSaveAs     : PChar;            { Restructure to this table }
  4972.       pszKeyviolName : PChar;           { Keyviol table name  (optional) }
  4973.       pszProblemsName : PChar;          { Problems table name (optional) }
  4974.       bAnalyzeOnly  : Bool              { Analyze restructure }
  4975.    ): DBIResult stdcall;
  4976.  
  4977. function DbiRenameTable (               { Rename table & family }
  4978.       hDb           : hDBIDb;           { Database handle }
  4979.       pszOldName    : PChar;            { Old name }
  4980.       pszDriverType : PChar;            { Driver type /NULL }
  4981.       pszNewName    : PChar             { New name }
  4982.    ): DBIResult stdcall;
  4983.  
  4984. function DbiDeleteTable (               { Delete a table }
  4985.       hDb           : hDBIDb;           { Database handle }
  4986.       pszTableName  : PChar;            { Name including any path }
  4987.       pszDriverType : PChar             { Driver type /NULL }
  4988.    ): DBIResult stdcall;
  4989.  
  4990. function DbiAddIndex (                  { Add a new index }
  4991.       hDb           : hDBIDb;           { Database handle }
  4992.       hCursor       : hDBICur;          { Cursor (OR) }
  4993.       pszTableName  : PChar;            { Table name including any path }
  4994.       pszDriverType : PChar;            { Driver type /NULL }
  4995. var   IdxDesc       : IDXDesc;          { Description of the index }
  4996.       pszKeyviolName : PChar            { Keyviol table name (optional) }
  4997.    ): DBIResult stdcall;
  4998.  
  4999. function DbiDeleteIndex (               { Delete index }
  5000.       hDb           : hDBIDb;           { Database handle }
  5001.       hCursor       : hDBICur;          { Cursor (OR) }
  5002.       pszTableName  : PChar;            { Table name }
  5003.       pszDriverType : PChar;            { Driver type /NULL }
  5004.       pszIndexName  : PChar;            { Index name }
  5005.       pszIndexTagName : PChar;          { Index tagname (xbase MDX) }
  5006.       iIndexId      : Word              { Index number }
  5007.    ): DBIResult stdcall;
  5008.  
  5009. {===========================================================================}
  5010. {                            Error Info                                     }
  5011. {===========================================================================}
  5012.  
  5013. function DbiGetErrorEntry (             { Get error entry }
  5014.       uEntry        : Word;             { Error stack entry }
  5015. var   ulNativeError : Longint;          { Returned. Native error code, if any }
  5016.       pszError      : PChar             { Returned. Error string, if any }
  5017.    ): DBIResult stdcall;
  5018.  
  5019. function DbiGetErrorInfo (              { Return info on last error }
  5020.       bFull         : Bool;             { If Full details }
  5021. var   ErrInfo       : DBIErrInfo        { Error Info }
  5022.    ): DBIResult stdcall;
  5023.  
  5024. function DbiGetErrorString (            { Get message for error code }
  5025.       rslt          : DBIResult;        { Engine error code }
  5026.       pszError      : PChar             { Error string for the error }
  5027.    ): DBIResult stdcall;
  5028.  
  5029. function DbiGetErrorContext (           { Get specific Context if available }
  5030.       eContext      : SmallInt;         { Context type }
  5031.       pszContext    : PChar             { Context string (MAXMSGLEN +1) }
  5032.    ): DBIResult stdcall;
  5033.  
  5034. {============================================================================}
  5035. {                              Dbi Services                                  }
  5036. {============================================================================}
  5037.  
  5038. function DbiDateEncode (                { Encode Date components into Date }
  5039.       iMon          : Word;             { Month    (1..12) }
  5040.       iDay          : Word;             { Day      (1..31) }
  5041.       iYear         : SmallInt;         { Year     (0..2**16-1) }
  5042. var   dateD         : DBIDATE           { Encoded date }
  5043.    ): DBIResult stdcall;
  5044.  
  5045. function DbiDateDecode (                { Decode Date into components }
  5046.       dateD         : DBIDATE;          { Encoded Date }
  5047. var   iMon          : Word;             { Month }
  5048. var   iDay          : Word;             { Day }
  5049. var   iYear         : SmallInt          { Year }
  5050.    ): DBIResult stdcall;
  5051.  
  5052. function DbiTimeEncode (                { Encode Time components into TIME }
  5053.       iHour         : Word;             { Hours (0..23) }
  5054.       iMin          : Word;             { Minutes (0..59) }
  5055.       iMilSec       : Word;             { Milli Seconds (0..59999) }
  5056. var   timeT         : Time              { Encoded Time }
  5057.    ): DBIResult stdcall;
  5058.  
  5059. function DbiTimeDecode (                { Decode TIME into components }
  5060.       timeT         : Time;             { Encoded Time }
  5061. var   iHour         : Word;             { Hours (0..23) }
  5062. var   iMin          : Word;             { Minutes (0..59) }
  5063. var   iMilSec       : Word              { Milli Seconds (0..59999) }
  5064.    ): DBIResult stdcall;
  5065.  
  5066. function DbiTimeStampEncode (           { Encode Date & TIme into Date+Time }
  5067.       dateD         : DBIDATE;          { Encoded Date }
  5068.       timeT         : Time;             { Encoded Time }
  5069. var   tsTS          : TimeStamp         { Encoded Date+Time }
  5070.    ): DBIResult stdcall;
  5071.  
  5072. function DbiTimeStampDecode (           { Decode Date & Time from Date+Time }
  5073.       tsTS          : TIMESTAMP;        { Encoded Date+Time }
  5074. var   dateD         : DBIDATE;          { Encoded Date }
  5075. var   timeT         : Time              { Encoded Time }
  5076.    ): DBIResult stdcall;
  5077.  
  5078.  
  5079. function DbiBcdFromFloat (              { Converts FLOAT number into FMTBcd format }
  5080. var   iVal          : Double;           { Float to convert }
  5081.       iPrecision    : Word;             { Precision of BCD }
  5082.       iPlaces       : Word;             { Number of decimals }
  5083. var   Bcd           : FMTBcd            { returns Bcd number (length = iPrecision +2) }
  5084.    ): DBIResult stdcall;
  5085.  
  5086. function DbiBcdToFloat (                { Converts FMTBcd number to FLOAT }
  5087. var   Bcd           : FMTBcd;           { Bcd number to convert }
  5088. var   iVal          : Double            { Returns converted float }
  5089.    ): DBIResult stdcall;
  5090.  
  5091. {===========================================================================}
  5092. {                           CallBacks                                       }
  5093. {===========================================================================}
  5094.  
  5095. function DbiRegisterCallBack (          { Register a call back fn }
  5096.       hCursor       : hDBICur;          { Cursor (Optional) }
  5097.       ecbType       : CBType;           { Type of call back }
  5098.       iClientData   : Longint;          { Pass-thru client data }
  5099.       iCbBufLen     : Word;             { Callback buffer len }
  5100.       CbBuf         : Pointer;          { Pointer to callback buffer }
  5101.       pfCb          : pfDBICallBack     { Call back fn being registered }
  5102.    ): DBIResult stdcall;
  5103.  
  5104. function DbiGetCallBack (               { Register a call back fn }
  5105.       hCursor       : hDBICur;          { Cursor (Optional) }
  5106.       ecbType       : CBType;           { Type of call back }
  5107.       piClientData  : PLongint;         { Pass-thru client data }
  5108.       piCbBufLen    : PWord;            { Callback buffer len }
  5109.       ppCbBuf       : Pointer;          { Pointer to callback buffer }
  5110. var   pfCb          : pfDBICallBack     { Call back fn being registered }
  5111.    ): DBIResult stdcall;
  5112.  
  5113. {============================================================================}
  5114. {                          Date, time formats                                }
  5115. {============================================================================}
  5116.  
  5117.  
  5118. function DbiGetDateFormat (             { Get current date format }
  5119. var   fmtDate       : FMTDate
  5120.    ): DBIResult stdcall;
  5121.  
  5122. function DbiSetDateFormat (             { Set current date format }
  5123. var   fmtDate       : FMTDate
  5124.    ): DBIResult stdcall;
  5125.  
  5126. function DbiGetTimeFormat (             { Get current time format }
  5127. var   fmtTime       : FMTTime
  5128.    ): DBIResult stdcall;
  5129.  
  5130. function DbiSetTimeFormat (             { Set current time format }
  5131. var   fmtTime       : FMTTime
  5132.    ): DBIResult stdcall;
  5133.  
  5134. function DbiGetNumberFormat (           { Get current number format }
  5135. var   fmtNumber     : FMTNumber
  5136.    ): DBIResult stdcall;
  5137.  
  5138. function DbiSetNumberFormat (           { Set current number format }
  5139. var   fmtNumber     : FMTNumber
  5140.    ): DBIResult stdcall;
  5141.  
  5142. {============================================================================}
  5143. {                      Conversions                                           }
  5144. {============================================================================}
  5145.  
  5146. function DbiNativeToAnsi (              { Convert from native to Ansi }
  5147.       LdObj         : Pointer;          { Language driver }
  5148.       pAnsiStr      : PChar;            { Destination buffer (opt) }
  5149.       pNativeStr    : PChar;            { Source buffer }
  5150.       iLen          : Longint;          { Length of buffer (opt) }
  5151. var   bDataLoss     : Bool              { Returns TRUE if conversion will loose data (opt) }
  5152.    ): DBIResult stdcall;
  5153.  
  5154. function DbiAnsiToNative (              { Convert from Ansi to native }
  5155.       LdObj         : Pointer;          { Language driver }
  5156.       pNativeStr    : PChar;            { Destination buffer (opt) }
  5157.       pAnsiStr      : PChar;            { Source buffer }
  5158.       iLen          : Longint;          { Length of buffer (opt) }
  5159. var   bDataLoss     : Bool              { Returns TRUE if conversion will loose data (opt) }
  5160.    ): DBIResult stdcall;
  5161.  
  5162. {============================================================================}
  5163. {                            Filters                                         }
  5164. {============================================================================}
  5165.  
  5166. function DbiAddFilter (                 { Add a filter to the cursor }
  5167.       hCursor       : hDBICur;          { Cursor handle }
  5168.       iClientData   : Longint;          { Client supplied data      (opt) }
  5169.       iPriority     : Word;             { 1..N with 1 being highest (opt) }
  5170.       bCanAbort     : Bool;             { TRUE if pfFiltercan return ABORT (opt) }
  5171.       pcanExpr      : pCANExpr;         { Expression tree        (opt) }
  5172.       pfFilter      : pfGENFilter;      { ptr to filter function (opt) }
  5173. var   hFilter       : hDBIFilter        { Returns filter handle }
  5174.    ): DBIResult stdcall;
  5175.  
  5176. function DbiDropFilter (                { Drop a filter }
  5177.       hCursor       : hDBICur;          { Cursor handle }
  5178.       hFilter       : hDBIFilter        { Filter handle }
  5179.    ): DBIResult stdcall;
  5180.  
  5181. function DbiActivateFilter (            { Activate a Filter }
  5182.       hCursor       : hDBICur;          { Cursor handle }
  5183.       hFilter       : hDBIFilter        { Filter handle }
  5184.    ): DBIResult stdcall;
  5185.  
  5186. function DbiDeactivateFilter (          { Deactivate Filter }
  5187.       hCursor       : hDBICur;          { Cursor handle }
  5188.       hFilter       : hDBIFilter        { Filter handle }
  5189.    ): DBIResult stdcall;
  5190.  
  5191. function DbiGetFilterInfo (             { Get filter information }
  5192.       hCur          : hDBICur;          { Cursor handle }
  5193.       hFilter       : hDBIFilter;       { Filter handle          /NULL }
  5194.       iFilterId     : Word;             { Filter id              /0 }
  5195.       iFilterSeqNo  : Word;             { Filter sequence number /0 }
  5196. var   Filterinfo    : FilterInfo        { Returns filter info }
  5197.    ): DBIResult stdcall;
  5198.  
  5199. {============================================================================}
  5200. {                            Linked Cursors                                  }
  5201. {============================================================================}
  5202.  
  5203. function DbiBeginLinkMode (             { Convert cursor to a link cursor }
  5204. var   hCursor       : hDBICur           { In/Out : returns new cursor }
  5205.    ): DBIResult stdcall;
  5206.  
  5207. function DbiEndLinkMode (               { Convert cursor back to normal cursor }
  5208. var   hCursor       : hDBICur           { In/Out : returns original cursor }
  5209.    ): DBIResult stdcall;
  5210.  
  5211. function DbiLinkDetail (                { Link detail to master }
  5212.       hMstrCursor   : hDBICur;          { Master cursor }
  5213.       hDetlCursor   : hDBICur;          { Detail cursor }
  5214.       iLnkFields    : Word;             { Number of link fields }
  5215.       piMstrFields  : PWord;            { Array of fields in master }
  5216.       piDetlFields  : PWord             { Array of fields in detail }
  5217.    ): DBIResult stdcall;
  5218.  
  5219. function DbiLinkDetailToExp (           { Link detail to a master using exp }
  5220.       hCursorMstr   : hDBICur;          { Master cursor }
  5221.       hCursorDetl   : hDBICur;          { Detail cursor }
  5222.       iKeyLen       : Word;             { Key length to match }
  5223.       pszMstrExp    : PChar             { Expression string }
  5224.    ): DBIResult stdcall;
  5225.  
  5226. function DbiUnlinkDetail (              { Unlink detail from master }
  5227.       hDetlCursor   : hDBICur           { Detail cursor to unlink }
  5228.    ): DBIResult stdcall;
  5229.  
  5230. function DbiGetLinkStatus (             { Query linkage info for table }
  5231.       hCursor       : hDBICur;          { Cursor handle }
  5232. var   hCursorMstr   : hDBICur;          { Returns master cursor, if any   (opt) }
  5233. var   hCursorDet    : hDBICur;          { Returns first detail cursor, if any (opt) }
  5234. var   hCursorSib    : hDBICur           { Returns next sibling detail cursor, if any (opt) }
  5235.    ): DBIResult stdcall;
  5236.  
  5237.  
  5238. {===========================================================================}
  5239. {                            Translation                                    }
  5240. {===========================================================================}
  5241.  
  5242.  
  5243. function DbiTranslateRecordStructure (  { Translate a record }
  5244.       pszSrcDriverType : PChar;         { Source driver type }
  5245.       iFlds         : Word;             { Number of fields }
  5246.       pfldsSrc      : pFLDDesc;         { Array of source fields: logical or physical types }
  5247.       pszDstDriverType : PChar;         { Destination driver type }
  5248.       pszLangDriver : PChar;            { Language driver for destination }
  5249.       pfldsDst      : pFLDDesc;         { Array of dest. fields returned }
  5250.       bCreatable    : Bool              { TRUE -> map to creatable fields only. }
  5251.    ): DBIResult stdcall;
  5252.  
  5253. function DbiOpenFieldXlt (              { Open translation object }
  5254.       pszSrcTblType : PChar;            { NULL for Logical }
  5255.       pszSrcLangDrv : PChar;            { NULL if no tranliteration }
  5256.       pfldSrc       : pFLDDesc;         { source field descriptor }
  5257.       pszDestTblType : PChar;           { NULL for Logical }
  5258.       pszDstLangDrv : PChar;            { NULL if no tranliteration }
  5259.       pfldDest      : pFLDDesc;         { Source field descriptor }
  5260. var   bDataLoss     : Bool;             { Set to TRUE, for data loss }
  5261. var   hXlt          : hDBIXlt           { Returned translate handle }
  5262.    ): DBIResult stdcall;
  5263.  
  5264. function DbiTranslateField (            { Translate a field }
  5265.       hXlt          : hDBIXlt;          { Translation handle }
  5266.       pSrc          : Pointer;          { Source field }
  5267.       pDest         : Pointer           { Destination field }
  5268.    ): DBIResult stdcall;
  5269.  
  5270. function DbiCloseFieldXlt (             { Close translation object }
  5271.       hXlt          : hDBIXlt           { Translation handle }
  5272.    ): DBIResult stdcall;
  5273.  
  5274. {=========================================================================}
  5275. {    Delayed Updates                                                      }
  5276. {=========================================================================}
  5277.  
  5278. function DbiBeginDelayedUpdates (       { put cursor in delayed update mode }
  5279. var   hCursor       : hDBICur           { In/Out : returns new Cursor }
  5280.    ): DBIResult stdcall;
  5281.  
  5282. function DbiEndDelayedUpdates (         { Convert cursor back to normal cursor }
  5283. var   hCursor       : hDBICur           { In/Out : returns original Cursor }
  5284.    ): DBIResult stdcall;
  5285.  
  5286. function DbiApplyDelayedUpdates (       { Perform the specified operation. }
  5287.       hCursor       : hDBICur;          { Delayed update cursor handle }
  5288.       eUpdCmd       : DBIDelayedUpdCmd  { Op Type: Commit or Rollback. }
  5289.    ): DBIResult stdcall;
  5290.  
  5291. {===========================================================================}
  5292. {                                 MISC.                                     }
  5293. {===========================================================================}
  5294.  
  5295.  
  5296. function DbiGetTableOpenCount (         {  Get local cursor count }
  5297.       hDb           : hDBIDb;           { Database }
  5298.       pszTableName  : PChar;            { Table name }
  5299.       pszDriverType : PChar;            { Driver type /NULL }
  5300. var   iOpenCount    : Word              { returned number of cursors }
  5301.    ): DBIResult stdcall;
  5302.  
  5303. function DbiUseIdleTime: DBIResult stdcall;     { Use Idle time }
  5304.  
  5305. function DbiGetLdObj (                  { Get language driver }
  5306.       hCursor       : hDBICur;          { Cursor handle }
  5307. var   pLdObj        : Pointer           { Returned language driver object }
  5308.    ): DBIResult stdcall;
  5309.  
  5310. function DbiGetLdName (                 { Get language driver name from table }
  5311.       pszDriver     : PChar;            { Driver name }
  5312.       pObjName      : PChar;            { Name of object, i.e. table name }
  5313.       pLdName       : PChar             { Returned language driver name }
  5314.    ): DBIResult stdcall;
  5315.  
  5316. function DbiFormFullName (              { Form Full Name }
  5317.       hDb           : hDBIDb;           { Database handle }
  5318.       pszTableName  : PChar;            { Table name }
  5319.       pszDriverType : PChar;            { Driver type /NULL }
  5320.       pszFullName   : PChar             { Returns full name }
  5321.    ): DBIResult stdcall;
  5322.  
  5323. function DbiAddPassword (               { Add a password to current session }
  5324.       pszPassword   : PChar             { Password }
  5325.    ): DBIResult stdcall;
  5326.  
  5327. function DbiDropPassword (              { Drop a password from current session }
  5328.       pszPassword   : PChar             { password/NULL }
  5329.    ): DBIResult stdcall;
  5330.  
  5331. function DbiGetNetUserName (            { Get network username }
  5332.       pszNetUserName : PChar            { Returns username }
  5333.    ): DBIResult stdcall;
  5334.  
  5335.  
  5336. function DbiDebugLayerOptions (         { Get SDK debug layer options }
  5337.       iOption       : Word;             { Option }
  5338.       pDebugFile    : PChar
  5339.    ): DBIResult stdcall;
  5340.  
  5341. function DbiOpenCfgInfoList (           { Open a cursor on "Config" }
  5342.       hCfg          : hDBICfg;          { NULL }
  5343.       eOpenMode     : DBIOpenMode;      { ReadWrite or readonly }
  5344.       eConfigMode   : CFGMode;          { Config mode }
  5345.       pszCfgPath    : PChar;            { Path }
  5346. var   hCur          : hDBICur           { Returned cursor }
  5347.    ): DBIResult stdcall;
  5348.  
  5349. function DbiImportODBC(                 { Import current ODBC drivers and data sources }
  5350.       hCfg          : hDBICfg;          { NULL }
  5351.       bPersist      : Bool              { Persistent or session relative }
  5352.    ): DBIResult stdcall;
  5353.  
  5354. function DbiAddAlias (                  { Add a new alias }
  5355.       hCfg          : hDBICfg;          { NULL }
  5356.       pszAliasName  : PChar;            { Alias name }
  5357.       pszDriverType : PChar;            { Driver type for alias }
  5358.       pszParams     : PChar;            { Optional parameters }
  5359.       bPersist      : Bool              { Persistent or session relative }
  5360.    ): DBIResult stdcall;
  5361.  
  5362. function DbiDeleteAlias (               { Delete an alias }
  5363.       hCfg          : hDBICfg;          { NULL }
  5364.       pszAliasName  : PChar             { Alias name }
  5365.    ): DBIResult stdcall;
  5366.  
  5367. function DbiAddDriver(                  { Add a new driver }
  5368.       hCfg          : hDBICfg;          { NULL }
  5369.       pszDriverName : PChar;            { Driver name }
  5370.       pszParams     : PChar;            { Optional parameters }
  5371.       bPersist      : Bool              { Persistent or session relative }
  5372.    ): DBIResult stdcall;
  5373.  
  5374. function DbiDeleteDriver(               { Delete a driver }
  5375.       hCfg          : hDBICfg;          { NULL }
  5376.       pszDriverName : PChar;            { Driver name }
  5377.       bSave         : Bool              { Save config file }
  5378.    ): DBIResult stdcall;
  5379.  
  5380.  
  5381. {===========================================================================}
  5382. {                      Query Management                                     }
  5383. {===========================================================================}
  5384.  
  5385. function DbiQExecDirect (               { Execute query }
  5386.       hDb           : hDBIDb;           { Database handle }
  5387.       eQryLang      : DBIQryLang;       { Query language }
  5388.       pszQuery      : PChar;            { Query }
  5389.       phCur         : phDBICur          { Returned cursor on result set }
  5390.    ): DBIResult stdcall;
  5391.  
  5392. function DbiQAlloc (                    { Allocates a statement handle }
  5393.       hDb           : hDBIDb;           { Database handle }
  5394.       eQryLang      : DBIQryLang;       { Query language }
  5395. var   hStmt         : hDBIStmt          { Returned statment handle }
  5396.    ): DBIResult stdcall;
  5397.  
  5398. function DbiQPrepare (                  { Prepare a query }
  5399.       hStmt         : hDBIStmt;         { Returned statment handle }
  5400.       pszQuery      : PChar             { Query }
  5401.    ): DBIResult stdcall;
  5402.  
  5403. function DbiQPrepareExt (               { Prepare a query }
  5404.       hDb           : hDBIDb;           { Database handle }
  5405.       eQryLang      : DBIQryLang;       { Query language }
  5406.       pszQuery      : PChar;            { Query }
  5407.       propBits      : Word;             { properties for Prepare, e.g. qprepFORUPDATE }
  5408. var   hStmt         : hDBIStmt          { Returned statment handle }
  5409.    ): DBIResult stdcall;
  5410.  
  5411. function DbiQExec (                     { Execute prepared query }
  5412.       hStmt         : hDBIStmt;         { Statement handle }
  5413.       phCur         : phDBICur          { Returned handle on result set }
  5414.    ): DBIResult stdcall;
  5415.  
  5416. function DbiQFree (                     { Free statement handle }
  5417. var   hStmt         : hDBIStmt          { Statement handle }
  5418.    ): DBIResult stdcall;
  5419.  
  5420. function DbiQSetParams (                { Set query options }
  5421.       hStmt         : hDBIStmt;         { Statement handle }
  5422.       uFldDescs     : Word;             { Number of parameter field descriptors }
  5423.       paFldDescs    : pFLDDesc;         { Array of parameter field descriptors }
  5424.       pRecBuff      : Pointer           { Record buffer }
  5425.    ): DBIResult stdcall;
  5426.  
  5427. function DbiQInstantiateAnswer (        { Create answer table }
  5428.       hStmt         : hDBIStmt;         { Statement Handle }
  5429.       hCur          : hDBICur;          { Cursor Handle }
  5430.       pszAnswerName : PChar;            { Answer Table Name/NULL }
  5431.       pszAnswerType : PChar;            { Answer Table Type/NULL }
  5432.       bOverWrite    : Bool;             { Overwrite Flag }
  5433.       phCur         : phDBICur          { cursor to instantiated table (output)(optional) }
  5434.    ): DBIResult stdcall;
  5435.  
  5436. function DbiQExecProcDirect (           { Direct execution of stored procedure }
  5437.       hDb           : hDBIDb;           { Database handle }
  5438.       pszProc       : PChar;            { Stored procedure name }
  5439.       uParamDescs   : Word;             { Number of parameter descriptors }
  5440.       paParamDescs  : pSPParamDesc;     { Array of parameter descriptors }
  5441.       pRecBuff      : Pointer;          { Record buffer }
  5442. var   hCur          : hDBICur           { Returned handle on result set }
  5443.    ): DBIResult stdcall;
  5444.  
  5445. function DbiQPrepareProc (              { Prepare a stored procedure }
  5446.       hDb           : hDBIDb;           { Database handle }
  5447.       pszProc       : PChar;            { Stored procedure name }
  5448.       uParamDescs   : Word;             { Number of parameter descriptors }
  5449.       paParamDescs  : pSPParamDesc;     { Array of parameter descriptors }
  5450.       pRecBuff      : Pointer;          { Record buffer }
  5451. var   hStmt         : hDBIStmt          { Returned statment handle }
  5452.    ): DBIResult stdcall;
  5453.  
  5454. function DbiQSetProcParams (            { Set procedure params }
  5455.       hStmt         : hDBIStmt;         { Statement handle }
  5456.       uParamDescs   : Word;             { Number of parameter descriptors }
  5457.       paParamDescs  : pSPParamDesc;     { Array of parameter descriptors }
  5458.       pRecBuff      : Pointer           { Record buffer }
  5459.    ): DBIResult stdcall;
  5460.  
  5461. type
  5462.   PSTMTBaseDesc = ^STMTBaseDesc;
  5463.   STMTBaseDesc = packed record 
  5464.     szDatabase   : DBINAME; 
  5465.     szTableName  : DBITBLNAME; 
  5466.     szFieldName  : DBINAME; 
  5467.     bExpression  : Bool; 
  5468.     bAggregate   : Bool; 
  5469.     bConstant    : Bool;
  5470.   end;
  5471.  
  5472. function DbiQGetBaseDescs( 
  5473.       hStmt         : hDBIStmt;         { Statement Handle }
  5474. var   hCur          : hDBICur           { Cursor of type STMTBaseDesc }
  5475.    ): DBIResult stdcall;
  5476.  
  5477.  
  5478. implementation
  5479.